os.path.getmtime on winXP

Jorg Rødsjø jorg at neoplex.org
Tue Nov 8 07:33:12 EST 2005


Bengt Richter wrote:
> By 'getmtime' you mean os.path.getmtime(fer_shure_or_absolute_path_to_file) right?
> Doesn't that get you an integer number of seconds? What GUI or win32file is showing you
> that integer so you see a 3600 sec difference? Or how are you seeing it?
> 
> Could you paste an example of this difference from an example on your screen?
> I don't think I am understanding ;-) ... urk, it's late ;-/

(Btw: thanks for the interest.)

Step by step example:
[I do of cource not modify the foo.py-file at any time during the testing.]

With the system-date set to the 8th of november(no dst) I run the following
os.path.getmtime('spam.py'), and get 1045578240 as the result.

With the system-date set to the 8th of october(dst) I run the following
os.path.getmtime('spam.py'), and get 1045581840 as the result.

This is what boggles my mind. These numbers should be the same -- right? 
Not offsett by 3600.

On both dates, calling Windows win32file.GetFileTime (from the Python 
Win32 Extensions) gives me the time 02/18/03 14:24:00 -- i.e. the same 
both before and after setting the time.

I have not looked at the source to either win32file.GetFileTime or 
os.path.getmtime, but I should think that they should both call the same 
underlying Windows-function.

I hope this makes it more clear. Any idea why this happens?

regards
Jorg Rødsjø



More information about the Python-list mailing list