[Zope3-dev] Re: Daylight savings unittest errors

Barry Pederson bp@barryp.org
Wed, 11 Jun 2003 09:43:35 -0500


R. David Murray wrote:
> Barry Pederson <bp@barryp.org> wrote:
> 
>>(There are daily reports posted to this list from a FreeBSD machine running 
>>the unittests...what timezone is it running in?)
> 
> 
> US Eastern.

That's a bit mysterious then..I was expecting it'd be in some strange place 
that doesn't do daylight savings time.

If you have a moment, could you try running this bit of Python on that 
FreeBSD box, to see how it compares to the output I get on mine, and what 
Guido gets on his US Eastern, but non-FreeBSD box.

-----------------
import time
now = 1055176982
gm = time.gmtime(now)

print 'original time:', now
print 'timezone:', time.timezone, 'altzone:', time.altzone, 'daylight:', 
time.daylight
print 'gmtime:', gm
print 'mktime:', time.mktime(gm)
print 'roundtrip:', (time.mktime(gm) - time.timezone) - now

gm1 = gm[:8] + (1,)
print 'roundtrip +1:', (time.mktime(gm1) - time.timezone) - now
gm2 = gm[:8] + (-1,)
print 'roundtrip -1:', (time.mktime(gm2) - time.timezone) - now
------------------

On mine I get:
------
original time: 1055176982
timezone: 21600 altzone: 18000 daylight: 1
gmtime: (2003, 6, 9, 16, 43, 2, 0, 160, 0)
mktime: 1055194982.0
roundtrip: -3600.0
roundtrip +1: -3600.0
roundtrip -1: -3600.0
------

	Barry