Time differences between USB - HD

Christian Franke Christian.Franke@t-online.de
Mon Oct 26 11:27:00 GMT 2009


Angelo Graziosi wrote
> Just now we are back to Standard Time, I noticed that the files on USB
> key have timestamps +1 hour, compared to the same on HD.
> 
> This happens only under Cygwin: there is not difference under DOS box.
> 

This is "normal" if the filesystems differ between HD (NTFS) and USB key
(FAT?). NTFS stores file times as UTC, FAT as local time.

The problem is the interesting design (IMO this is a bug:-) of the Win32
file time conversion functions:

http://msdn.microsoft.com/en-us/library/ms724277(VS.85).aspx
http://www.codeproject.com/KB/datetime/dstbugs.aspx
http://support.microsoft.com/kb/158588

The difference between Cygwin and other apps occur because Cygwin uses
its own (correct) UTC->localtime conversion but apps like explorer and
cmd uses the (broken) conversion from Win32 API.

Example: http://sourceware.org/ml/cygwin/2007-06/msg00455.html


Christian




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list