getmtime differs between Py2.5 and Py2.4

John Machin sjmachin at lexicon.net
Mon May 7 20:59:51 EDT 2007


On May 8, 9:15 am, Irmen de Jong <irmen.NOS... at xs4all.nl> wrote:
> Martin v. Löwis wrote:
> >> Is this a bug?
>
> > Why don't you read the responses posted earlier? John Machin
> > replied (in <1178232636.415630.106... at l77g2000hsb.googlegroups.com>)
> > that you are mistaken: There is NO difference between the outcome
> > of os.path.getmtime between Py2.5 and Py2.4. It always did return
> > UTC, and always will.
>
> > Regards,
> > Martin
>
> Err.....:
>
> [E:\Projects]dir *.py
>
>   Volume in drive E is Data           Serial number is 2C4F:9C2D
>   Directory of  E:\Projects\*.py
>
> 31-03-2007  20:46             511  log.py
> 25-11-2006  16:59             390  p64.py
>   7-03-2007  23:07             207  sock.py
>   3-02-2007  16:15             436  threads.py
>            1.544 bytes in 4 files and 0 dirs    16.384 bytes allocated
>      287.555.584 bytes free
>
> [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.

HTH,
John




More information about the Python-list mailing list