X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 	tests=AWL,BAYES_50
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4AE4E191.3070205@alice.it>
References: <4AE4E191.3070205@alice.it>
Date: Mon, 26 Oct 2009 11:56:54 +0100
Reply-To: "Christian Franke" <Christian.Franke@t-online.de>
To: "Cygwin" <cygwin@cygwin.com>
Subject: Re: Time differences between USB - HD
From: "Christian Franke" <Christian.Franke@t-online.de>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Message-ID: <1N2NFu-08y0tE0@fwd04.aul.t-online.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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

