Just another Perl shrine | |
PerlMonks |
Re: How to calculate if today is before May 1 -- onelinerby Discipulus (Canon) |
on Dec 29, 2019 at 18:16 UTC ( [id://11110734]=note: print w/replies, xml ) | Need Help?? |
Hello htmanning, Dates are delicate things, and you must use care and recommended modules, as already shown. But for such a trivial task you can simply check if you are in January-April (months 0-3 in localtime's 4th element in the list form) ie (localtime(time))[4]<=3 to be sure being before 1st of May:
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|