Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 81116
Status: resolved
Priority: 0/
Queue: Date-Manip

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

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



Subject: ParseDate bug with dates in format YYYYWwwd
Date: Mon, 12 Nov 2012 11:02:34 +0000
To: <bug-date-manip [...] rt.cpan.org>
From: Chris Card <ctcard [...] hotmail.com>
Hi, This bug appears to be in perl-Date-Manip 6.24 on Centos 6.3 and in the latest perl-Date-Manip 6.36 built on Fedora 16, so I assume it's in all versions of Date::Manip > 6. I've tried with Perl 5.10.1 (Centos 6.3) and Perl 5.14.3 and Perl 5.16.0 (Fedora 16). The Perl command     perl -e 'use Date::Manip; $x = ParseDate("2012-W01-1"); print $x . "\n";' prints     2012010200:00:00 but the command     perl -e 'use Date::Manip; $x = ParseDate("2012-W011"); print $x . "\n";' prints nothing. Using the DM5 module instead does work: DATE_MANIP=DM5 perl -e 'use Date::Manip; $x = ParseDate("2012-W011"); print $x . "\n";' Looking at the manual page Date::Manip::Date for the definitions of valid date formats, I think 2012-W011 should be accepted as a valid date (and was in  Date::Manip version 5.x). Chris
The ISO 8601 standard supports two formats: 2012W011 2012-W01-1 It does not explicitly support: 2012-W011 It is true that with Date::Manip 5.xx, I relaxed all sorts of restrictions and allowed this format, but with 6.xx, I cleaned up the regexps I used and stuck more closely to the standards. As a result, the third form no longer works. I could easily add it of course, but the standard is very consistent about separating ALL of the fields with dashes or NONE of them, and I think I want to stick with that consistency. I looked over the man page, and the 6.xx manual (Date::Manip::Date) only lists the YYWwwD and YY-Www-D format. These are not to be confused with the formats with a leading dash (-YWwwD and -Y-Www-D) where the leading dash has a different meaning than the separating dashed in the standard. Hope this answers your question.
Subject: RE: [rt.cpan.org #81116] ParseDate bug with dates in format YYYYWwwd
Date: Tue, 13 Nov 2012 22:21:56 +0000
To: "bug-date-manip [...] rt.cpan.org" <bug-date-manip [...] rt.cpan.org>
From: Chris Card <ctcard [...] hotmail.com>
Show quoted text
> The ISO 8601 standard supports two formats: > > 2012W011 > 2012-W01-1 > > It does not explicitly support: > > 2012-W011 > > It is true that with Date::Manip 5.xx, I relaxed all sorts of > restrictions and allowed this format, but with 6.xx, I cleaned up the > regexps I used and stuck more closely to the standards. As a result, > the third form no longer works. > > I could easily add it of course, but the standard is very consistent > about separating ALL of the fields with dashes or NONE of them, and I > think I want to stick with that consistency. > > I looked over the man page, and the 6.xx manual (Date::Manip::Date) only > lists the YYWwwD and YY-Www-D format. These are not to be confused with > the formats with a leading dash (-YWwwD and -Y-Www-D) where the leading > dash has a different meaning than the separating dashed in the standard. > > Hope this answers your question. >
Thanks, I re-read the manual page and I can see now that the dashes are no longer optional in 6.xx. Chris