http://www.perlmonks.org?node_id=422961


in reply to Human Readable Date

What's wrong with the perl builtin functions localtime or gmtime? To get a human readable string from epoch time you can simply:

my $str = scalar localtime $s->mtime();

Substitute localtime with gmtime if you need GMT time. If you want more control over the format of the time, look at POSIX::strftime(), as in the following example:

use POSIX qw/strftime/; my $str = POSIX::strftime "%F %T", localtime $s->mtime();
--
edan