I’ve been busy with a lot of time dependant code this week and working in Unix Time (number of seconds since epoch) has been making my brain go a bit squishy. Here a nice little code snippet for converting unixtime to a proper timestamp

perl -e 'print scalar localtime($ARGV[0]),"\n"' [unixtime] so: perl -e 'print scalar localtime($ARGV[0]),"\n"' 1172160024
Thu Feb 22 16:00:24 2007

If you use this a lot, there’s nothing to stop you putting this in a nice little script, such as:

#!/bin/perl
print scalar localtime($ARGV[0]),"\n"