note
ikegami
<p>Not all days are 24*60*60 seconds long<strike>, and $m suffers from off-by-one errors</strike>. Fix:
<c>
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);
</c>
<p>You'll need to import <c>timelocal_nocheck</c> from [mod://Time::Local]
<p><b>Updated</b>. However, the fixed code doesn't work because timelocal_nocheck doesn't handle $m+1 as I expect.
556225
556229