Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Time-Local CPAN distribution.

Report information
The Basics
Id: 44826
Status: resolved
Priority: 0/
Queue: Time-Local

People
Owner: Nobody in particular
Requestors: stan767 [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug using Mar 31, 2009 date
Date: Mon, 6 Apr 2009 14:59:38 -0400
To: <bug-time-local [...] rt.cpan.org>
From: stan nats <stan767 [...] hotmail.com>
I'm using Perl version 5.8.7 and Local.pm version 1.11 and version 1.1901 and both tell me that using March 31, 2009 is an invalid day-of-month: Perl Program: #!... use Time::Local; $time1 = timelocal(0,0,0,31,3,2009); print $time1; Output: Day '31' out of range 1..30 at prog.pl line 4 I noticed that in line 118 of Local.pm my $md = $MonthDays[$month]; should be: my $md = $MonthDays[$month-1]; since the offset to the array starts at 0 and not 1; Stan. Show quoted text
_________________________________________________________________ Internet Explorer 8 helps keep your personal info safe. http://go.microsoft.com/?linkid=9655581
Subject: Re: [rt.cpan.org #44826] Bug using Mar 31, 2009 date
Date: Mon, 6 Apr 2009 14:52:26 -0500 (CDT)
To: stan nats via RT <bug-Time-Local [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Mon, 6 Apr 2009, stan nats via RT wrote: Show quoted text
> I'm using Perl version 5.8.7 and Local.pm version 1.11 and version 1.1901 and both tell me that using March 31, 2009 is an invalid day-of-month: > > Perl Program: > #!... > use Time::Local; > > $time1 = timelocal(0,0,0,31,3,2009); > print $time1; > > Output: > > Day '31' out of range 1..30 at prog.pl line 4 > > > I noticed that in line 118 of Local.pm > > my $md = $MonthDays[$month]; > > should be: > > my $md = $MonthDays[$month-1]; > > since the offset to the array starts at 0 and not 1;
If I had a nickel for every time this "bug" was reported. The docs explicitly say that the months start at 0 (0..11). It's dumb, but this is the inverse of localtime, and that's how localtime does it. Please don't respond to this bug, as doing so will re-open it. Thanks, -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/