Skip Menu |
 

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 92611
Status: new
Priority: 0/
Queue: TimeDate

People
Owner: Nobody in particular
Requestors: honir999 [...] gmail.com
Cc:
AdminCc:

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



Subject: str2time wrong date when no year specified
Date: Fri, 31 Jan 2014 10:31:43 +0000
To: bug-TimeDate [...] rt.cpan.org
From: <honir999 [...] gmail.com>
Download (untitled) / with headers
text/plain 603b
Parsing dates when no year specified, for a future month generates wrong year. perl -e "use Date::Parse; print str2time('31 Jan');" 1391126400 i.e. Fri, 31 Jan 2014 00:00:00 GMT but perl -e "use Date::Parse; print str2time('1 Feb');" 1359676800 i.e. Fri, 01 Feb 2013 00:00:00 GMT Wrong year: expected output 1391212800 i.e. Sat, 01 Feb 2014 00:00:00 GMT Code causing the error is line 252, which is always subtracting 1 from the year for a future month when the year is undefined. $year = ($month > $lt[4]) ? ($lt[5] - 1) : $lt[5] unless(defined $year); Date::Parse 2.30 perl, v5.8.8


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.