[python-win32] Why I get wrong filetime values with win32 api(FindFilesW) ?

John Machin sjmachin at lexicon.net
Thu May 11 12:35:19 CEST 2006


On 11/05/2006 5:47 PM, Christian Stooker wrote:
> Mark Hammond írta:
>> I'm guessing it is related to the GMT offset.  The MSDN docs for the
>> FILETIME structure say:
>>
>>   Furthermore, FAT records times on disk in local time. However,
>>   NTFS records times on disk in UTC. For more information ...
>>
>> Otherwise I'm afraid I have no idea...
>>
>> Mark
>>
>>   
> 
> Hi !
> 
> As I say: interesting, because os.get*time functions get good result for 
> the files.

[snip]

> 
> As you can see, the different is two hours.
> We are in GMT+01 timezone,

Call me crazy, but the Brits are on summer time (UTC+1) and you should 
be on CEST (Central Europe Summer Time) (UTC+2).

Check this out: http://www.timeanddate.com/worldclock/city.html?n=50

> and I use NTFS and WXP.      
> 

Here's what I got with your code, with NTFS, in eastern Australia 
(UTC+10), local time is after 8 p.m.

C:\junk\winfiletime>winfiletime.py
[u'C:\\junk\\winfiletime\\winfiletime.py']
pw32 1147306617
pyos 1147342617
pw32 Thu May 11 10:16:57 2006
pyos Thu May 11 20:16:57 2006

As expected.






More information about the Python-win32 mailing list