delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/26/06:27:34

X-Recipient: archive-cygwin AT delorie DOT 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 DOT 3070205 AT alice DOT it>
Date: Mon, 26 Oct 2009 11:56:54 +0100
Reply-To: "Christian Franke" <Christian DOT Franke AT t-online DOT de>
To: "Cygwin" <cygwin AT cygwin DOT com>
Subject: Re: Time differences between USB - HD
From: "Christian Franke" <Christian DOT Franke AT t-online DOT de>
Message-ID: <1N2NFu-08y0tE0@fwd04.aul.t-online.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019