[ZCM] [ZC] 252/ 2 Accept "DateTime Bug"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Wed, 27 Feb 2002 21:33:02 -0500


Issue #252 Update (Accept) "DateTime Bug"
 Status Accepted, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/252

==============================================================
= Accept - Entry #2 by ajung on Feb 27, 2002 9:32 pm

 Status: Pending => Accepted

 Supporters added: ajung

workaround: try DateTime('02-29-2003')

-aj
________________________________________
= Request - Entry #1 by Anonymous User on Feb 27, 2002 1:39 pm

If you try to create a date from a string
that represents a leap day using '-'
as the delimitor (ie '2-29-2002')
for a year that IS NOT a leap year then
it will return a DateTime object for the first day
of the year.

here is the output from the python interpreter.
(using python 2.1.1 and Zope 2.4.3, note this
problem still exists in Zope 2.5)

>>> import DateTime
>>> d = DateTime.DateTime('2-29-2003')
>>> d
DateTime('2003/01/01')

It also appears to keep returning that date
when you pass in a valid date string...

But if you use '/' instead of '-' then it 
will throw an error.





==============================================================