delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/19/16:39:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <40843862.5040209@ntlworld.com>
Date: Mon, 19 Apr 2004 21:36:50 +0100
From: Mark Thornton <mark DOT p DOT thornton AT ntlworld DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Unix time conversion error
References: <OFC8C5EA23 DOT 519825B6-ONC1256E7B DOT 003D6BDC-C1256E7B DOT 003E3E2D AT philips DOT com>
In-Reply-To: <OFC8C5EA23.519825B6-ONC1256E7B.003D6BDC-C1256E7B.003E3E2D@philips.com>
X-IsSubscribed: yes

jurgen DOT defurne AT philips DOT com wrote:

>Hello,
>
>I have a conversion problem. When I convert UNIX timestamps
>to datetime representations, they are one hour off. Does this have to
>with the following mail (indeed we are now in DST) ?
>
>http://www.cygwin.com/ml/cygwin/2003-10/msg00995.html
>  
>
If you mean that timestamps for date/times in winter (i.e. not DST) are
shown incorrectly, then yes this is a problem that afflicts many
applications. From the referenced MS document:

"By rewriting the affected application(s) to use the appropriate Win32
API calls, this problem can be corrected. Under NTFS, the Win32 API
GetFileTime"

Anything which uses the standard C calls unfortunately gets an adjusted
value, and this is what most applications ported from Unix do, resulting
in this problem. Microsoft did this to minimise the surprise to people
using FAT file systems which were most common at the time. The decision
to use the offset for today on all timestamps including those applying
to a date when the offset would have (or will be) different was
deliberate (Microsoft refuse to consider it a bug).

I suppose we could ask whether cygwin should replace the relevant calls
with better alternatives. Otherwise implement your own or live with the
pain.

Mark Thornton




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

- Raw text -


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