perl -e 'print scalar( gmtime( 915725119 ) ),"\n"'
prints
Thu Jan 7 16:05:19 1999
Update:There's a lot of talk about which CPAN date module to use but for whatever reason, I always fall back on Date::Manip. With that module, you have tons of control over lots of most aspects of
time:
perl -MDate::Manip -e 'print UnixDate( ParseDate(scalar(gmtime(9157251
+19))), "%m/%d/%Y %i:%M:%S %p"), "\n"'
(there's probably tons of ways to simplify that). Or if you just need a pretty string, you could always use strftime:
#!/usr/bin/perl
use POSIX qw( strftime );
print strftime( "%m/%d/%Y %l:%M:%S %p", gmtime( 915725119 ) ), "\n";
(format strings to strftime tend to be platform dependent)
|