Just another Perl shrine | |
PerlMonks |
Re: Date to epochby Utilitarian (Vicar) |
on Jul 19, 2012 at 07:38 UTC ( [id://982598]=note: print w/replies, xml ) | Need Help?? |
the mktime function in the POSIX module is your friend here.
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."
In Section
Seekers of Perl Wisdom
|
|