getmtime differs between Py2.5 and Py2.4

Alex Martelli aleax at mac.com
Mon May 7 23:04:35 EDT 2007


John Machin <sjmachin at lexicon.net> wrote:

> > [E:\Projects]c:\Python24\python.exe -c "import os; print
os.path.getmtime('p64.py')"
> > 1164470381
> >
> > [E:\Projects]c:\Python25\python.exe -c "import os; print
os.path.getmtime('p64.py')"
> > 1164466781.28
> >
> > This is python 2.4.4 and Python 2.5.1 on windows XP.
> > The reported time clearly differs.
> >
> > --Irmen
> 
> Well nitpicked, but irrelevant to the OP's perceptual problem.
> 
> The reported time clearly differs due to the result being (as
> documented) now a float instead of an int. The OP is complaining about
> an alleged difference of time-zone magnitude (i.e. at least 30
> minutes, not 0.28 seconds). Somehow he has got the idea that Python
> 2.4 & earlier returned local time, not UTC.

Please look at those number again, beyond the float/int distinction.

>>> 1164466781.28 - 1164470381
-3599.7200000286102

the difference (rounding to an int number of seconds) is just about one
hour; in certain parts of the world (Europe and Africa), that could
indeed be a timezone issue.


Alex



More information about the Python-list mailing list