Dual-license your content for inclusion in The Perl 5 Wiki using this HOWTO, or join us for a chat on irc.freenode.net#PerlNet.

User:Blm/DatesAndTimes

From PerlNet

Jump to: navigation, search

time() function:

- returns the current time in seconds since epoch (00:00:00 1 Jan 1970) - according the the pod for Time::Unix this may be platform dependant.

localtime() function:

takes a time expressed as seconds since epoch and provides a nine element list representing local time

   #  0    1    2     3     4    5     6     7     8
   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

gmtime() function:

takes a time expressed as seconds since epoch and provides a nine element list representing greenwich mean time

   #  0    1    2     3     4    5     6     7     8
   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);


Date::Manip

Time::ParseDate

DateTime module

- construct a DateTime object from the components of a date and time or epoch and perform maths with the date and print dates in a user specified format.


Class::Date

Personal tools