Comment 14 for bug 143784

Revision history for this message
Brett Carter (bacarter) wrote :

This patch appears to break backwards API compatibility. DateTime() objects now assume any date entered is in GMT unless a timezone is specified. This is contrary to zope 2.9.5 behavior where the timezone is assumed to be the system default. The new code is also inconsistent:

print "\n>>>>>> ", DateTime().timezone()
print "\n>>>>>> ", DateTime('2006-02-27').timezone()
print "\n>>>>>> ", DateTime('2006-02-27 12:30:00').timezone()
print "\n>>>>>> ", DateTime().greaterThan(DateTime('2007-02-27 01:00:00'))

Prints:
>>>>>> US/Pacific
>>>>>> GMT+0
>>>>>> GMT+0
>>>>>> True

Note that a DateTime() with no string returns an instance in the the machine's timezone (Pacific) however all other instances are in GMT. This really screws up the final comparison, where we end up comparing a GMT time to a Pacific time.