summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniemeyer <>2008-02-28 05:00:57 +0000
committerniemeyer <>2008-02-28 05:00:57 +0000
commit3cb423c2805524de8f7ec6a664d3def33859420a (patch)
treea2542f3f4a12ae85d820f605a7c439904d760d7c
parent05c217d3ae21303cc4d5ccff241854caf44af317 (diff)
downloaddateutil-3cb423c2805524de8f7ec6a664d3def33859420a.tar.gz
Fixed DST signal handling in zoneinfo files. Reported by
Nicholas F. Fabry and John-Mark Gurney. (that changeset adds just the test, the actual fix was committed in the last revision by mistake).
-rw-r--r--NEWS4
-rw-r--r--test.py9
2 files changed, 12 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 27fd1cc..fd54ae0 100644
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,9 @@ Version 1.4
- Calls like gettz("GMT+3") and gettz("UTC-2") will now return the
expected values, instead of the TZ variable behavior.
-
+
+- Fixed DST signal handling in zoneinfo files. Reported by
+ Nicholas F. Fabry and John-Mark Gurney.
Version 1.3
diff --git a/test.py b/test.py
index b7ad75e..f58a558 100644
--- a/test.py
+++ b/test.py
@@ -3877,6 +3877,15 @@ END:VTIMEZONE
self.assertEqual(datetime(2003,10,26,0,59,tzinfo=tz).tzname(), "EDT")
self.assertEqual(datetime(2003,10,26,1,00,tzinfo=tz).tzname(), "EST")
+ def testZoneInfoOffsetSignal(self):
+ utc = gettz("UTC")
+ nyc = zoneinfo.gettz("America/New_York")
+ t0 = datetime(2007,11,4,0,30, tzinfo=nyc)
+ t1 = t0.astimezone(utc)
+ t2 = t1.astimezone(nyc)
+ self.assertEquals(t0, t2)
+ self.assertEquals(nyc.dst(t0), timedelta(hours=1))
+
def testICalStart1(self):
tz = tzical(StringIO(self.TZICAL_EST5EDT)).get()
self.assertEqual(datetime(2003,4,6,1,59,tzinfo=tz).tzname(), "EST")