The PyTime value in the WIN32_FIND_DATA object returned from FindFilesIterator() is incorrect. Say fdata is an instance returned from FindFilesIterator(), then time.localtime(int(fdata)) returns the UTC time, not the local time.
(1) Create a new text file, say C:\test.txt
(2) Observe the modification date.
(3) Run the script on the command line with the path to the file created in (1) as the argument, e.g. pytimebug.py C:\test.txt
(4) Observe local time printed on screen is incorrect; in fact it is the UTC time.
Log in to post a comment.