hurley hurley - 3 years ago 187
Perl Question

Convert Unix timestamp to a readable date in Perl

I have some Unix timestamps (for example, 1357810480, so they're mainly in the past). How can I transform them into a readable date-format using Perl?

Answer Source

You can use localtime for that.

my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($unix_timestamp);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download