{Spam?} [Tutor] problem with time module

Bob Gailer bgailer at alum.rpi.edu
Sat Aug 14 23:04:06 CEST 2004


At 01:06 PM 8/14/2004, Dick Moores wrote:
> From the time module doc at
><http://docs.python.org/lib/module-time.html>,
>I expected mktime(localtime()) and time() to be approx. 7*3600 seconds 
>apart (I'm on the U.S. west coast, in -0700).
>
>But they're not:
>
> >>> from time import *
> >>> mktime(localtime());time()
>1092510279.0
>1092510279.2650001

Try:
mktime(gmtime())-time()

This suggests that time() is giving the local time rather than GMT.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625 home
720 938 2625 cell 



More information about the Tutor mailing list