TOUCH and DST

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Dec 20, 2008
3
0
#1
I want to touch modify date and time of some files, putting current date and 0:00 as time, so I use this command:

touch /d%_date /t0:00 *.*

The problem occurs when there is a DST (daylight saving time) change. When it occurs, the files that I modified before the change shows after the change a wrong time, or 23:00 of the previous day, or 1:00 of the current day, depending of the type of the DST change.

Is there any way to avoid this? Thanks.
 
May 29, 2008
36
0
#2
> I want to touch modify date and time of some files, putting current date and 0:00 as time, so I use this command:
>
> touch /d%_date /t0:00 *.*
>
> The problem occurs when there is a DST (daylight saving time) change. When it occurs, the files that I modified before the change shows after the change a wrong time, or 23:00 of the previous day, or 1:00 of the current day, depending of the type of the DST change.
>
> Is there any way to avoid this? Thanks.
>
This is a "feature" of NTFS and has been a problem for years. NTFS always
converts file times to UTC before storing them. They are converted back when you
retrieve them but they will be converted based on the current, local, DST setting.

Article "http://support.microsoft.com/kb/129574" tries to explain/justify this
behavior.

The only real solution is to keep your system time as UTC. Not very appealing to
most of us.
 
#3
dbartt wrote:
| This is a "feature" of NTFS and has been a problem for years. NTFS
| always converts file times to UTC before storing them. They are
| converted back when you retrieve them but they will be converted
| based on the current, local, DST setting.
|
| Article "http://support.microsoft.com/kb/129574" tries to
| explain/justify this behavior.
|
| The only real solution is to keep your system time as UTC. Not very
| appealing to most of us.

Actually, it's not NTFS itself, but the OS, which misconverts from UTC to
local time during information retrieval, if the DST status of the event is
different from the current DST status. IIRC some plugins do correct this.
--
Steve
 
#4
As others have stated, the problem is with the OS. If you want to see
dir-like listing that shows the right times, you might get good
results from my timedir program found at jcook.net/timedir

It is largely compatible with dir from TCC but I went out of my way to
use a time conversion that is incompatible with Windows so that the
times would not shift as you've seen. Note that timedir will (by
default) display different times than explorer, cmd, and TCC which
agree with each other but not the wall clock.

On Fri, Nov 6, 2009 at 5:47 AM, estibbons <> wrote:

> I want to touch modify date and time of some files, putting current date and 0:00 as time, so I use this command:
>
> touch /d%_date /t0:00 *.*
>
> The problem occurs when there is a DST (daylight saving time) change. When it occurs, the files that I modified before the change shows after the change a wrong time, or 23:00 of the previous day, or 1:00 of the current day, depending of the type of the DST change.
>
> Is there any way to avoid this? Thanks.
>
>
>
>
>


--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.