diff options
author | Arch Librarian <arch@canonical.com> | 2005-05-10 20:58:00 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2005-05-10 20:58:00 +0000 |
commit | 75aa0a5348c908b2206d133e372ae9710c898fed (patch) | |
tree | 41b6e03432dfe77cc556aa2af48ffc7137693906 /gen_tzinfo.py | |
parent | ee4354e87b66be23c8f62bcf96a4ccfb5bc2ab52 (diff) | |
download | pytz-75aa0a5348c908b2206d133e372ae9710c898fed.tar.gz |
Handle multiple in-dst zones in sequence correctly (US/...
Author: zenzen
Date: 2004-07-22 00:56:19 GMT
Handle multiple in-dst zones in sequence correctly (US/Eastern's EWT & EPT for example)
Diffstat (limited to 'gen_tzinfo.py')
-rw-r--r-- | gen_tzinfo.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gen_tzinfo.py b/gen_tzinfo.py index 9be94b8..66cdafb 100644 --- a/gen_tzinfo.py +++ b/gen_tzinfo.py @@ -1,6 +1,6 @@ #!/usr/bin/env python ''' -$Id: gen_tzinfo.py,v 1.16 2004/07/19 22:31:45 zenzen Exp $ +$Id: gen_tzinfo.py,v 1.17 2004/07/22 00:56:19 zenzen Exp $ ''' import sys, os, os.path, shutil @@ -174,7 +174,12 @@ class DstGen(Gen): if not inf[1]: dst = 0 else: - dst = inf[0] - transitions[i-1][1] # seconds dstoffset + # Locate the last non-dst transition + for j in range(i-1, -1, -1): + prev_trans = transitions[j] + if not prev_trans[2]: + break + dst = inf[0] - prev_trans[1] # seconds dstoffset dst = dst.seconds + dst.days*86400 tzname = inf[2] |