[zope2-tracker] [Bug 1045233] [NEW] DateTime parsing assumes "US" style mm/dd/yyyy

Chui Tey teyc at cognoware.com
Mon Sep 3 09:25:03 UTC 2012

Public bug reported:

The parsing heuristics assume that if a date time looks like this "11-01-2001", then it is November 11.
Actually at non-US sites, it is 11th of January. 

--- a/Lib/site-packages/datetime-2.12.6-py2.7.egg/DateTime/DateTime.py
+++ b/Lib/site-packages/datetime-2.12.6-py2.7.egg/DateTime/DateTime.py

@@ -984,8 +986,12 @@ class DateTime:

             elif ints[0] <= 12:
-                month=ints[0]
-                day=ints[1]
+                if datefmt=="us":
+                    day=ints[1]
+                    month=ints[0]
+                else:
+                    day=ints[0]
+                    month=ints[1]
             del ints[:3]

** Affects: zope2
     Importance: Undecided
         Status: New

You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.

  DateTime parsing assumes "US" style mm/dd/yyyy

To manage notifications about this bug go to:

More information about the zope2-tracker mailing list