python 1.5.2 time bug?

Anton Gluck gluc at midway.uchicago.edu
Wed Nov 1 22:43:43 CET 2000


In article <1JXL5.3845$jv2.434000 at newsc.telia.net>,
Fredrik Lundh <fredrik at effbot.org> wrote:
>Anton Gluck wrote:
>> Is there possibly a bug in Python 1.5.2 in its handling of the time? Since
>> yesterday python tells me that it's December 31 1969. I've tried this on my
>> own machine (running Windows 2000) and on a Unix machine at work (some flavor
>> of Solaris). time.clock() returns values close to 0 (but increasing -
>> apparently the clock was reset? it rolled over?), and
>> time.asctime(time.localtime(time.clock())) gives me the 1969 date.
>
>looks like a pilot error:
>
>time.clock() gives you the process time, in seconds since an
>arbitrary point in time (usually when the process was started).
>Clock values may roll over after a relatively short time (like,
>say, after 36 minutes)
>
>to get the real ("wall") time, use time.time().
>
></F>

You are right - how embarassing! In my defense I can only say that I have been 
using time.clock() in JPython, always getting the correct dates...

Anton Gluck



More information about the Python-list mailing list