[Buildbot-commits] [Buildbot] #2522: test_changes_mail_CVSMaildirSource fails in some timezones
Buildbot trac
trac at buildbot.net
Sat Sep 7 22:34:15 UTC 2013
#2522: test_changes_mail_CVSMaildirSource fails in some timezones
----------------------+------------------------
Reporter: rutsky | Owner:
Type: undecided | Status: new
Priority: major | Milestone: undecided
Version: master | Resolution:
Keywords: |
----------------------+------------------------
Comment (by dustin):
Well, looking at the source indicates that's not the case:
{{{
#!python
def mktime_tz(data):
"""Turn a 10-tuple as returned by parsedate_tz() into a UTC
timestamp."""
if data[9] is None:
# No zone info, so localtime is better assumption than GMT
return time.mktime(data[:8] + (-1,))
else:
t = time.mktime(data[:8] + (0,))
return t - data[9] - time.timezone
}}}
So, I wonder if `time.timezone` doesn't correspond to the correct offset.
MSK is GMT+4, so `time.timezone` should be `-14400`. Let's try an
experiment. In your timezone, `time.mktime((2010, 8, 4, 4, 0, 0, 0, 0,
0))` should be UTC midnight on August 4:
{{{
1280880000.0
>>> time.gmtime(1280880000.0)
time.struct_time(tm_year=2010, tm_mon=8, tm_mday=4, tm_hour=0, tm_min=0,
tm_sec=0,
tm_wday=2, tm_yday=216, tm_isdst=0)
}}}
Does that match up so far? If so, I bet this is a DST thing, and I don't
entirely understand the `tm_isdst` thing.
--
Ticket URL: <http://trac.buildbot.net/ticket/2522#comment:6>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the Commits
mailing list