Problem with timezone

10 views
Skip to first unread message

Slawomir Testowy

unread,
Feb 5, 2010, 7:41:39 AM2/5/10
to asciidoc
Hi,

asciidoc seems to print invalid timezone in the footer. E.g. now we
have CET, but asciidoc prints CEST.

Patch below seems to solve this problem for me.

diff -r ac5ee7d908d1 asciidoc.py
--- a/asciidoc.py Tue Jan 26 10:11:06 2010 +1300
+++ b/asciidoc.py Fri Feb 05 13:40:31 2010 +0100
@@ -1054,7 +1054,7 @@
"""Convert seconds since the Epoch to formatted local time
string."""
t = time.localtime(t)
s = time.strftime('%H:%M:%S',t)
- if time.daylight:
+ if time.daylight and t.tm_isdst == 1:
result = s + ' ' + time.tzname[1]
else:
result = s + ' ' + time.tzname[0]

--
regards
Slawomir Testowy

Stuart Rackham

unread,
Feb 6, 2010, 12:07:09 AM2/6/10
to asci...@googlegroups.com
Thanks very much for the patch, you are quite correct, time.daylight only says
the zone supports a daylight saving timezone, it doesn't tell us which one we're
meant to use. Added to trunk:

http://hg.sharesource.org/asciidoc/rev/077944134cab


Cheers, Stuart

Reply all
Reply to author
Forward
0 new messages