🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10577

Re: FindFirstFile, FILETIME, and Daylight Savings

#10577
From: Bob Gonder
Date: Mon, 05 Apr 2004 18:13
51 lines
2814 bytes
Andrue Cope wrote:

>On Sun, 04 Apr 2004 17:30:42 -0700, Bob Gonder wrote:
>
>> 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.

No need to be sorry, I enjoy puzzles, but this one...

>Actually what you have here /is/ a time that doesn't change and it *is*
>UTC.
That's what I thought, but if I save it, as is, and later compare it
with itself, it's different.?

> 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.

So you're saying that FindFirstFile doesn't return UTC? That Local
time affects the returned value?

>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

I thought that was what I was doing.

>at the functions FileTimeToLocalTime and LocalTimeToFileTime for
>inspiration.

Umm.. ok...Lessee now...
FindFirstFile returns  10:15UTC.  I push that through
FileTimeToLocalFileTime and get 9:15BST. Which I then put into
LocalFileTimeToFileTime to get 10:15UTC again.
Ok, fine, but if I started with, and binary saved, the UTC from
FindFirstFile.....how's that any different?

Still confused....

Unless CompareFileTime is somehow changing things?
But, also what I don't get
April 3, 10:15  doesn't change to 
April 3,  9:15 just because this is April 5.
Technical Details
Message-ID: <ma6370d3jao3sjn3craod7n6jo4eioraq8@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com> <ak8rt8ua80v1$.zw3u0r86c55l.dlg@40tude.net>

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 11:40:12 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: FindFirstFile, FILETIME, and Daylight Savings
Date: Mon, 05 Apr 2004 11:13:20 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <ma6370d3jao3sjn3craod7n6jo4eioraq8@4ax.com>
References: <1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com> <ak8rt8ua80v1$.zw3u0r86c55l.dlg@40tude.net>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.227.145.214
X-Trace: newsgroups.borland.com 1081188803 4.227.145.214 (5 Apr 2004 11:13:23 -0800)
Lines: 55
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail