Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/