DateTime
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| DateTime |
Invalid
|
Medium
|
Unassigned |
Bug Description
Dates of the form YYYY-MM-DD which are not ISO 9610 dates should be interpreted in the local timzone context (as are all other date forms) whereas ISO9610 dates need to be interpreted as GMT. The patch below fixes the constructor to use the local timezone for dates which are not
in ISO9610 format. It also fixes a minor problem in the recognition of ISO9610 dates.
.
--- DateTime.py.orig Sun Jun 12 12:56:02 2005
+++ DateTime.py.patched Tue Jun 21 22:50:06 2005
@@ -1743,20 +1743,28 @@
z = fields[7]
if z and z.startswith('Z'):
- # Waaaa! This is wrong, since 'Z' and '+HH:MM'
- # are supposed to be mutually exclusive.
- # It's only here to prevent breaking 2.7 beta.
- z = z[1:]
-
- if z:
+ # OK this is gmt, hour_off and min_off are zero
+ tz = 'GMT%+03d%02d' % (hour_off,min_off)
+ if len(z)>1:
+ raise IndexError
+ elif z:
+ tz = 'GMT%+03d%02d' % (hour_off,min_off)
if fields[4]:
- return year,month,
+ else:
+ z = _calcDependentS
+ tz = self._calcTimez
+
+ else:
+ z = _calcDependentS
+ tz = self._calcTimez
+
+ return year,month,
def JulianDay(self):
"""
dennis allison (allison-stanford) wrote : | #0 |
Florent Guillaume (efge) wrote : | #1 |
affects: | zope2 → datetime |
There are no examples here that would allow anyone to reproduce the alleged problem. In order for anyone to fix this bug they have to know *what* exactly they are fixing.
Changed in datetime: | |
status: | New → Incomplete |
We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!
Changed in datetime: | |
status: | Incomplete → Invalid |
Please provide a unit test demonstrating the correct behaviour and failing with the old code.