The simplest formatting can be done with localtime.
print scalar localtime;
This takes epoch time as an argument but uses time by default so it is the same as:
print scalar localtime(time());
So you can do like:
print scalar localtime($epoch);
My favorite module for manipulating times/dates is POSIX.
http://www.opengroup.org/...99/xsh/strftime.html
eg..
print POSIX::strftime("%H:%M:%S", localtime);
print scalar localtime;
This takes epoch time as an argument but uses time by default so it is the same as:
print scalar localtime(time());
So you can do like:
print scalar localtime($epoch);
My favorite module for manipulating times/dates is POSIX.
http://www.opengroup.org/...99/xsh/strftime.html
eg..
Code:
use POSIX qw/strftime/; print POSIX::strftime("%H:%M:%S", localtime);