Skip Menu |

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

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

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

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



Subject: Strange default day value for incomplete dates
Date: Wed, 29 Jun 2011 12:33:59 -0400
To: bug-Date-Manip [...] rt.cpan.org
From: Steve Muskiewicz <smuskiew [...] gmail.com>
It seems like in the update to Date::Manip version 6, something has changed with regard to the default day of the month for incomplete dates. Apologies if I missed something in the documentation that may have already explained this behavior but since seems a little strange I'm wondering if it might actually be a bug? It seems as if for incomplete dates like "March 1999" or "April 2005", Date::Manip is using the century portion of the year to form the day of the month rather than the expected 1 value (which is how Date::Manip version 5 seems to work). Here's a sample script (run with both Date::Manip version 5 and 6 to illustrate, hoping the Perl version itself isn't too relevant to the issue): First the system (Fedora 14) with Date::Manip 6.24 $ perl -v This is perl 5, version 12, subversion 3 (v5.12.3) built for i386-linux-thread-multi $ perl -e 'use Date::Manip; print "Date::Manip version $Date::Manip::VERSION\n";' Date::Manip version 6.24 $ perl -e 'use Date::Manip; $dstr = shift; $date = ParseDate($dstr); $fmt = UnixDate($date,"%Y-%m-%d"); print "$dstr = $date ($fmt)\n";' "March 1999" March 1999 = 1999031900:00:00 (1999-03-19) $ perl -e 'use Date::Manip; $dstr = shift; $date = ParseDate($dstr); $fmt = UnixDate($date,"%Y-%m-%d"); print "$dstr = $date ($fmt)\n";' "April 2005" April 2005 = 2005042000:00:00 (2005-04-20) Now the system (Fedora 12) with Date::Manip 5.54 $ perl -v This is perl, v5.10.0 built for x86_64-linux-thread-multi $ perl -e 'use Date::Manip; print "Date::Manip version = $Date::Manip::VERSION\n"' Date::Manip version = 5.54 $ perl -e 'use Date::Manip; $dstr = shift; $date = ParseDate($dstr); $fmt = UnixDate($date,"%Y-%m-%d"); print "$dstr = $date ($fmt)\n";' "March 1999" March 1999 = 1999030100:00:00 (1999-03-01) $ perl -e 'use Date::Manip; $dstr = shift; $date = ParseDate($dstr); $fmt = UnixDate($date,"%Y-%m-%d"); print "$dstr = $date ($fmt)\n";' "April 2005" April 2005 = 2005040100:00:00 (2005-04-01) Please let me know if there's anything else I can test or other details you might need. And THANKS for an extremely useful module! regards, -steve
In the interest of simplifying parsing, parsing in 6.xx was made a bit more rigid. Incomplete dates are no longer supported by Date::Manip . From the Changes5to6 document: ==== Support dropped for a few formats I've dropped support for a few very uncommon (probably never used) formats. These include (with Jan 3, 2009 as an example): DD/YYmmm 03/09Jan DD/YYYYmmm 03/2009Jan mmmYYYY/DD Jan2009/03 YYYY/DDmmm 2009/03Jan mmmYYYY Jan2009 YYYYmmm 2009Jan The last two are no longer supported since they are incomplete. With the exception of the incomplete forms, these could be added back in with very little effort. If there is ever a request to do so, I probably will. ====
One other thing... what you're getting now is the (newly supported as of 6.xx) format: mmmDDYY
Subject: Re: [rt.cpan.org #69187] Strange default day value for incomplete dates
Date: Wed, 29 Jun 2011 13:22:35 -0400
To: bug-Date-Manip [...] rt.cpan.org
From: Steve Muskiewicz <smuskiew [...] gmail.com>
Ah! Sorry, now I remember seeing that paragraph in the POD docs but obviously it didn't register with me at the time. Thanks for setting me straight! On Wed, Jun 29, 2011 at 1:01 PM, Sullivan Beck via RT < bug-Date-Manip@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69187 > > > In the interest of simplifying parsing, parsing in 6.xx was made a bit > more rigid. Incomplete dates are no longer supported by Date::Manip . > From the Changes5to6 document: > > ==== > > Support dropped for a few formats > > I've dropped support for a few very uncommon (probably never used) > formats. These include (with Jan 3, 2009 as an example): > > DD/YYmmm 03/09Jan > DD/YYYYmmm 03/2009Jan > mmmYYYY/DD Jan2009/03 > YYYY/DDmmm 2009/03Jan > > mmmYYYY Jan2009 > YYYYmmm 2009Jan > > The last two are no longer supported since they are incomplete. > > With the exception of the incomplete forms, these could be added back in > with very little effort. If there is ever a request to do so, I probably > will. > > ==== > >