// Convert seconds since the epoch to a normal time string...
// You can do:
# $ date +'%s'
// to generate seconds since the epoch... or of course:
$ perl -e 'print time, $/;'
// The program...
my $time = shift;
die "Usage: $0 [TIME_IN_SECS_SINCE_EPOCH]\n" unless $time;
my @mon = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
my @day = qw( Sun Mon Tue Wed Thu Fri Sat );
printf "%4d-%02d-%02d %02d:%02d:%02d (%s %02d %s %04d)\n",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec,
$day[$wday], $mday, $mon[$mon], $year + 1900;