NAME

Util::Medley::DateTime - Class with various datetime methods.

VERSION

version 0.009

SYNOPSIS

my $dt = Util::Medley::DateTime->new;

#
# positional  
#
say $dt->localDateTime(time);

#
# named pair
#
say $dt->localDateTime(epoch => time);
 

DESCRIPTION

A small datetime library. This doesn't do any calculations itself, but provides some simple methods to call for getting the date/time in commonly used formats.

ATTRIBUTES

none

METHODS

localDateTime

Returns the local date/time in the format: YYYY-MM-DD HH:MM:SS.

usage:
$dt->localDateTime([time]);

$dt->localDateTime([epoch => time]);
args:
time [Int]

Epoch time used to generate date/time string. Default is now.

localDateTimeIsValid

Validates the date-time string against: YYYY-MM-DD HH:MM:SS. Also, checks if it is actually a valid date-time.

usage:
$dt->localDateTimeIsValid($dateTime);

$dt->localDateTime(dateTime => $dateTime);
args:
dateTime [Str]

The date-time string to validate.