DateTimeParser fails silently for certain inputs

Bug #139360 reported by Jonathan Knowles
12
Affects Status Importance Assigned to Milestone
BlueBream
New
Undecided
Unassigned
Launchpad itself
Won't Fix
Low
Unassigned
Zope 3
Won't Fix
Undecided
Unassigned
zope.datetime
Fix Released
Undecided
Tres Seaver

Bug Description

DateTimeParser fails silently for several classes of date with the hyphen ("-") as a separator character:

* M-DD-YYYY
* MM-D-YYYY
* YYYY-M-D
* YYYY-M-DD
* YYYY-MM-D

For dates matching any of the above patterns, DateTimeParser ignores the month and day components and always returns 1 for the month and day values. For example, the string '2-13-2001' is interpreted as January 1st 2001.

Seen in version 38178 of zope.app.datetimeutils.

Revision history for this message
Jonathan Knowles (jsk) wrote :
Revision history for this message
Jonathan Knowles (jsk) wrote :

A summary of the failing patterns with examples.

Jonathan Knowles (jsk)
Changed in blueprint:
assignee: nobody → jsk
importance: Undecided → High
Jonathan Knowles (jsk)
Changed in blueprint:
assignee: jsk → nobody
Changed in launchpad:
importance: Undecided → High
Revision history for this message
Eleanor Berger (intellectronica) wrote :

the mxDateTime library does a really good job at parsing lots of different date/time formats. maybe we should consider using it for parsing.

http://www.egenix.com/products/python/mxBase/mxDateTime/

Changed in blueprint:
status: New → Confirmed
Changed in launchpad:
status: New → Confirmed
Changed in zope3:
status: New → Confirmed
Joey Stanford (joey)
Changed in blueprint:
milestone: 1.1.10 → none
Revision history for this message
Andreas Jung (ajung) wrote :

"""

the mxDateTime library does a really good job at parsing lots of different date/time formats. maybe we should consider using it for parsing.

http://www.egenix.com/products/python/mxBase/mxDateTime/
"""

mxDateTime will never be used within Zope.

Curtis Hovey (sinzui)
Changed in blueprint:
importance: High → Low
Changed in launchpad-foundations:
importance: High → Low
Tres Seaver (tseaver)
Changed in zope3:
status: Confirmed → Won't Fix
Revision history for this message
Tres Seaver (tseaver) wrote :

The DateTimeParser class moved out of zope.app.datetime into zope.datetime as part of dependency reduction.

Changed in zope.datetime:
assignee: nobody → Tres Seaver (tseaver)
Revision history for this message
Tres Seaver (tseaver) wrote :

lp:~tseaver/zope.datetime/lp_139360 shows all 1638 tests from Jonathan Knowles suite passing against the version of 'parse' now in zope.datetime.(code unchanged since the 3.4.0 release). Recommended fix for application code is to import the 'parse' function and relateed stuff from zope.datetime, rather than the (now abandoned) zope.app.datetimeutils.

Changed in zope.datetime:
status: New → Fix Released
Revision history for this message
Curtis Hovey (sinzui) wrote :

lp.services.fields.FormattableDate supports the correct behaviour. The interfaces can be updated to use the better class. close this bug.

Revision history for this message
Robert Collins (lifeless) wrote :

Marked as wontfix in the lp components as per your comment.

Changed in launchpad-foundations:
status: Triaged → Won't Fix
Changed in blueprint:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers