Discussion:
FileTime problem - converting from local time
(too old to reply)
R.Wieser
2019-10-27 14:01:25 UTC
Permalink
Hello all,

I'm setting the LastWriteTime of a file (using SetFileTime), but only have a
local filetime. So, I first converted using
TzSpecificLocalTimeToSystemTime. The only problem is, for one of the
times*, that although the conversion returns the expected UTC time, when I
look at the file in "windows explorer" it shows to be an hour older/before
the supplied time.

Remark: The target drive drive is NTFS, so AFAIK no time shennigans as
happens with FAT32 drives.

* the problematic local time is from within the daylight-savings period,
while I'm currently outside of it. For the problematic time it shows, as
expected, two hours being subtracted.

-- Correct time (No DLS, same as current one)
2018/11/07 10:31.28 <-- Local time
2018/11/07 09:31.28 <-- applied to the file
2018/11/07 10:31.38 <-- Time shown

-- Problematic time (DLS, different to current one)
2019/10/25 14:51.52 <-- Local time
2019/10/25 12:51.52 <-- applied to the file
2019/10/25 13:51.52 <-- Time shown

(the above date is in yyyy/mm/dd format)

In other words, I /think/ I applied the right LastWriteTime to the file, and
am stumped to where the displayed time difference comes from ... Help ?

Regards,
Rudy Wieser
R.Wieser
2019-10-27 14:46:49 UTC
Permalink
I got a brainfart, and set my computers clock a month back (back into the
previous DLS time period). After F5-ing I saw the involved files (inside
and outside of that period) change their displayed times, something I did
not really expect. :-(

I thought that that kind of local time change shennigans went outof the
window with NTFS drives ? What is causing this change, and /why/ ?

Ackk ... Fully forgot to mention: I'm on a XPsp3 machine.

Regards,
Rudy Wieser
Charlie Gibbs
2019-10-28 18:28:38 UTC
Permalink
Post by R.Wieser
I got a brainfart, and set my computers clock a month back (back into the
previous DLS time period). After F5-ing I saw the involved files (inside
and outside of that period) change their displayed times, something I did
not really expect. :-(
I thought that that kind of local time change shennigans went outof the
window with NTFS drives ? What is causing this change, and /why/ ?
Ackk ... Fully forgot to mention: I'm on a XPsp3 machine.
Just a shot in the dark... have you applied the daylight saving time
patch? WinXP originally didn't know about the 2007 change in the U.S.
(I'm still running XP myself, under VirtualBox on my Linux machine.)
--
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ "Alexa, define 'bugging'."
R.Wieser
2019-10-28 19:26:14 UTC
Permalink
Charlie,
Post by Charlie Gibbs
WinXP originally didn't know about the 2007 change in the U.S.
I'm in Europe, The netherlands to be precise. I can't remember any
changes to the start and/or ending dated of the DLS period..

And the described problem is not about when they happen to change, but that
the displayed filetimes (coming from stored UTC filetimes on NTFS drives) do
not match what I think they should be.

Than again, it just might be me expecting something else than what the MS
programmers purposely created ...

Regards,
Rudy Wieser
Charlie Gibbs
2019-10-29 06:02:16 UTC
Permalink
Post by R.Wieser
Charlie,
Post by Charlie Gibbs
WinXP originally didn't know about the 2007 change in the U.S.
I'm in Europe, The netherlands to be precise. I can't remember any
changes to the start and/or ending dated of the DLS period..
And the described problem is not about when they happen to change, but that
the displayed filetimes (coming from stored UTC filetimes on NTFS drives) do
not match what I think they should be.
Than again, it just might be me expecting something else than what the MS
programmers purposely created ...
I suspect MS programmers purposely create a lot of things that are
different from what we expect...
--
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ "Alexa, define 'bugging'."
Loading...