http://www.perlmonks.org?node_id=982598


in reply to Date to epoch

the mktime function in the POSIX module is your friend here.
~/$ perl -MPOSIX -E 'say POSIX::mktime(15, 28, 06, 27, 02, 206);' 4299114495 ~/$ perl -E 'say scalar localtime (4299114495);' Sat Mar 27 06:28:15 2106
The important thing to note is that the year value is $year - 1900 (but of course you are going to read the POSIX pod now anyway in order to see how strftime works to create ISO date strings ;) )

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."