[Buildbot-commits] [Buildbot] #2362: Timezone problem with HgPoller

Buildbot nobody at buildbot.net
Thu Aug 30 14:24:25 UTC 2012


#2362: Timezone problem with HgPoller
---------------------+--------------------
Reporter:  gracinet  |       Owner:
    Type:  defect    |      Status:  new
Priority:  major     |   Milestone:  0.8.7
 Version:  master    |  Resolution:
Keywords:            |
---------------------+--------------------

Comment (by gracinet):

 Okay, my bad, a typical case of double correction:

 {{{
 >>> time.gmtime(1346158664)
 time.struct_time(tm_year=2012, tm_mon=8, tm_mday=28, tm_hour=12,
 tm_min=57, tm_sec=44, tm_wday=1, tm_yday=241, tm_isdst=0)
 >>> time.localtime(1346158664)
 time.struct_time(tm_year=2012, tm_mon=8, tm_mday=28, tm_hour=14,
 tm_min=57, tm_sec=44, tm_wday=1, tm_yday=241, tm_isdst=1)
 }}}

 So, the first number of hg log is the UTC timestamp (and the general
 convention is that timestamps are always UTC, since the epoch is expressed
 in UTC).
 The second number is an indication of the original timezone, of which
 buildbot does not care. By summing the two, !HgPoller is plain wrong.

 Prior checkings were done with ``datetime.fromtimestamp`` which actually
 converts to local time, but as a naive datetime instance, whence the
 confusion. Should have read more carefully the doc, sorry.

 I will propose a fix ASAP.

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2362#comment:3>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list