Problems with the date of modification of files on the flash drive in windows

Nobody nobody at nowhere.com
Sat Jan 23 02:19:40 EST 2010


On Fri, 22 Jan 2010 21:23:37 -0800, Aleksey wrote:

> I write crossplatform program and have next problem under windows
> (under linux is all OK) :
> 
> I'm trying to get the UTC modification date of files on the flash
> drive under windows. In the flash card system is FAT.

Timestamps stored on a FAT filesystem use an unspecified timezone. When a
Windows PC writes a timestamp to a FAT filesystem, it stores the current
local time. For devices such as cameras, the timestamp will be whatever's
in the device's clock if it has one (even if it does, there's no
guarantee that it's accurate), or some arbitrary value otherwise.

When reading a timestamp, it's just used as-is, i.e. it's a local time
with no timezone specified. There is no way to convert this value to UTC
or to a specific timezone. 

If you're using FAT, timestamps are pretty much meaningless unless the
device never travels between timezones (in which case, they'll probably
be roughly correct or wrong by roughly an hour either way due to DST).

When it comes to timezones, anything developed prior to NT
basically pretends that they don't exist.




More information about the Python-list mailing list