Thursday 9 October 2014

Converting Unix time to localtime in UNIX with PERL

Convert Unix time since the Jan 1st 1970 00:00 epoch to local time using PERL with this command :

$ perl -e 'print scalar (localtime(1246130142657481/1000000)),"\n"'
Sat Jun 27 20:15:42 2009


Use gmtime instead of localtime for GMT time.