Article View: borland.public.cppbuilder.nativeapi
Article #10559Re: FindFirstFile, FILETIME, and Daylight Savings
From: Andrue Cope
Date: Mon, 05 Apr 2004 08:06
Date: Mon, 05 Apr 2004 08:06
31 lines
2057 bytes
2057 bytes
On Sun, 04 Apr 2004 17:30:42 -0700, Bob Gonder wrote: > When posting to the db (flat binary file, nothing fancy like SQL), I > use the raw ftCreationTime. Then next time, I use CompareFileTime to > compare the saved value against the current ftCreationTime. > > I thought ftCreation time was supposed to be UTC, and hence not > affected by DST changes. > > What can I use to get a non-changing file time Heh, heh. Sorry. Actually what you have here /is/ a time that doesn't change and it *is* UTC. The point is that /you/ the user have entered daylight savings and so the time stamps on the files (which are still in UTC) appear to have changed but it's actually you that has done the changing. If you created a file at 10:15 UTC while based in the UK in January the time stamp would initially show as 10:15 (GMT). Then British Summer Time (daylight savings) starts and now the file shows 9:15. This is because 9:15 UTC is 10:15 BST. You need to change your database so that it stores its times in UTC. Look at the functions FileTimeToLocalTime and LocalTimeToFileTime for inspiration. -- Andrue Cope [Bicester UK]
Technical Details
Message-ID:
<ak8rt8ua80v1$.zw3u0r86c55l.dlg@40tude.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2bff2a2748be0347 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-05 01:09:31 PST From: Andrue Cope <no.spam@spammy.com> Subject: Re: FindFirstFile, FILETIME, and Daylight Savings Newsgroups: borland.public.cppbuilder.nativeapi User-Agent: 40tude_Dialog/2.0.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com> Date: Mon, 5 Apr 2004 09:06:07 +0100 Message-ID: <ak8rt8ua80v1$.zw3u0r86c55l.dlg@40tude.net> NNTP-Posting-Host: 217.207.223.34 X-Trace: newsgroups.borland.com 1081152415 217.207.223.34 (5 Apr 2004 01:06:55 -0800) Lines: 31 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail