getmtime differs between Py2.5 and Py2.4

John Machin sjmachin at lexicon.net
Tue May 8 00:36:26 EDT 2007


On May 8, 1:04 pm, a... at mac.com (Alex Martelli) wrote:
> John Machin <sjmac... 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.
>

Whoops! I looked at the start & the end but not the middle [sorry,
Irmen].

OK, I suspect a daylight-saving issue. I'm at UTC-1000, with no DST in
effect.
I get only the int/float difference, not a 1 hour difference and not a
10 hour difference.

What we need now is for someone in northern America or Asia (2 or more
hours offset from UTC), with and without DST if effect, to try it out.





More information about the Python-list mailing list