os.path.getmtime on winXP
Jorg Rødsjø
jorg at neoplex.org
Tue Nov 8 04:49:56 EST 2005
Bengt Richter wrote:
> How did you format the number you got from os.path.getmtime?
I'm not doing any formating at all. I am just looking at the numbers of
seconds since epoch. Which is what makes it so strange.
> You might want to try some of the above.
I'll do that. At the moment I'm looking at the difference between
localtime and gmtime to see if my computer is in dst. If it is not, I
just add 3600 seconds to the result from os.path.getmtime -- which then
should give consistent results.
> If you actually created/modified files just before and after the DST change
> and saw an extra hour difference instead of the time between the two actions,
> then maybe I'd look into whether the OS has some perverse option to use local DST
> time to record in the file stat info, but that's hard to believe. More likely someone
> is messing with with raw file time setting, like touch. Don't have it handy to see
> what DST assumptions it makes if any.
The files I am testing with have not been modified for a long time.
Windows reports the modified date as being the same, no matter what I do
(both through the gui, and through win32file). And they all show the
same strange 3600 sec difference with/without dst when I call getmtime
on them.
-jorg
More information about the Python-list
mailing list