[Zope3-dev] Re: Daylight savings unittest errors

R. David Murray rdmurray+dated+1055775439.538b37@bitdance.com
Wed, 11 Jun 2003 10:55:52 -0400 (EDT)


On Wed, 11 Jun 2003, Barry Pederson wrote:
> 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.
>
> -----------------
Script started on Wed Jun 11 10:49:46 2003
rdmurray@stage:~>name -a
FreeBSD stage.bitdance.com 4.8-RELEASE FreeBSD 4.8-RELEASE #14: Wed Jun  4 09:33:42 EDT 2003     root@stage.bitdance.com:/usr/obj/usr/src/sys/LOCAL  i386

[Editors note: I just did the 4.8 upgrade, and I think the autotests
haven't run successfully since I did so.  Before it was running 4.7.
I'm going to try running the tests by hand shortly]

rdmurray@stage:~>python2.2
Python 2.2.3 (#1, Jun  9 2003, 09:57:23)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> now = 1055176982
>>> gm = time.gmtime(now)
>>>
>>> print 'original time:', now
original time: 1055176982
>>> print 'timezone:', time.timezone, 'altzone:', time.altzone, 'daylight:',
timezone: 18000 altzone: 14400 daylight:
>>> time.daylight
1
>>> print 'gmtime:', gm
gmtime: (2003, 6, 9, 16, 43, 2, 0, 160, 0)
>>> print 'mktime:', time.mktime(gm)
mktime: 1055194982.0
>>> print 'roundtrip:', (time.mktime(gm) - time.timezone) - now
roundtrip: 0.0
>>>
>>> gm1 = gm[:8] + (1,)
>>> print 'roundtrip +1:', (time.mktime(gm1) - time.timezone) - now
roundtrip +1: -3600.0
>>> gm2 = gm[:8] + (-1,)
>>> print 'roundtrip -1:', (time.mktime(gm2) - time.timezone) - now
roundtrip -1: -3600.0
>>>
rdmurray@stage:~>python2.3
Python 2.3a2+ (#9, Apr 16 2003, 09:06:42)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> now = 1055176982
>>> gm = time.gmtime(now)
>>>
>>> print 'original time:', now
original time: 1055176982
>>> print 'timezone:', time.timezone, 'altzone:', time.altzone, 'daylight:',
timezone: 18000 altzone: 14400 daylight:
>>> time.daylight
1
>>> print 'gmtime:', gm
gmtime: (2003, 6, 9, 16, 43, 2, 0, 160, 0)
>>> print 'mktime:', time.mktime(gm)
mktime: 1055194982.0
>>> print 'roundtrip:', (time.mktime(gm) - time.timezone) - now
roundtrip: 0.0
>>>
>>> gm1 = gm[:8] + (1,)
>>> print 'roundtrip +1:', (time.mktime(gm1) - time.timezone) - now
roundtrip +1: -3600.0
>>> gm2 = gm[:8] + (-1,)
>>> print 'roundtrip -1:', (time.mktime(gm2) - time.timezone) - now
roundtrip -1: -3600.0
>>>

Script done on Wed Jun 11 10:50:29 2003