in reply to Re: Determining the dayname for the last day of any given month
in thread Determining the dayname for the last day of any given month
Not all days are 24*60*60 seconds long, and $m suffers from off-by-one errors. Fix:
my ($y, $m) = ($year-1900, $month-1); # Day before the first of next month: my $last = timelocal_nocheck(0, 0, 0, 1-1, $m+1, $y);
You'll need to import timelocal_nocheck from Time::Local
Updated. However, the fixed code doesn't work because timelocal_nocheck doesn't handle $m+1 as I expect.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Determining the dayname for the last day of any given month
by davorg (Chancellor) on Jun 20, 2006 at 15:52 UTC | |
by ikegami (Patriarch) on Jun 20, 2006 at 16:06 UTC |