in reply to Last day of the month. Any shorter
use Time::Local; sub is_last_day_of_month { my($y,$m,$d) = $_[0] =~ /(.{2,4})(..)(..)/; (gmtime(timegm(0,0,12,$d,$m-1,$y)+24*60*60))[4] != $m-1 } my $a = shift; print is_last_day_of_month($a) ? "$a: is last day of month\n" : "$a: is NOT last day of month\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Last day of the month. Any shorter
by greenFox (Vicar) on May 20, 2004 at 03:34 UTC | |
by jdporter (Paladin) on May 20, 2004 at 04:13 UTC | |
by greenFox (Vicar) on May 20, 2004 at 05:53 UTC | |
|
Re: Re: Last day of the month. Any shorter
by Scarborough (Hermit) on May 19, 2004 at 13:45 UTC |