Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

FileSetTime is 1 hour off on Windows 7 machine


  • Please log in to reply
8 replies to this topic
arkazal
  • Guests
  • Last active:
  • Joined: --
When I use FileSetTime to change the timestamp of a file, it's 1 hour off on my Windows 7 machine, but not on my XP or Vista machines. So, something like

FileSetTime, 19990301, file.txt, M

will modify file.txt's last modified date to March 1, 1999 at 12:00:00 AM on my XP and Vista machines, but on my Windows 7 machine, it will modify it to February 28, 1999, 11:00:00 PM. Even if I am explicit about it, and add HH24MISS to the time, it still comes out being an hour off.

I've tried searching the hour difference problem on Google, and I only get results for people running some kind of synchronization network, or some system that I can't begin to understand, so I can't really figure out how to solve this problem on my own. Maybe some of you will know more about FileSetTime's behavior on a Windows 7 system.

camerb
  • Moderators
  • 573 posts
  • Last active: Sep 14 2015 03:32 PM
  • Joined: 19 Mar 2009
I wonder if it is related to Daylight Savings Time... not sure.
Aren't you glad that I didn't put an annoying gif here?

arkazal
  • Guests
  • Last active:
  • Joined: --
So I guess nobody knows about AutoHotKey's behavior on Windows 7... anybody tried FileSetTime to see what they get? Is it just my computer? Is it Daylight Savings?

camerb
  • Moderators
  • 573 posts
  • Last active: Sep 14 2015 03:32 PM
  • Joined: 19 Mar 2009
It's just your computer, as far as I can tell, I've been able to confirm that FileSetTime works correctly on my Windows 7 machine. Do you have locale information? That could help shed some light on the issue. I'm in Texas, (Central Time).
Aren't you glad that I didn't put an annoying gif here?

arkazal
  • Guests
  • Last active:
  • Joined: --
I am in California (UTC -08:00). Daylight Savings is in effect.

Here's something odd: it worked on a batch of files I set to August 30, 2000. But when I did December 18 1999 and March 1 1999, it didn't work (it was one hour off). Is it because those dates are not part of Daylight Savings, while August 30 2000 is?

camerb
  • Moderators
  • 573 posts
  • Last active: Sep 14 2015 03:32 PM
  • Joined: 19 Mar 2009
Yep, I think that's it. And I'm guessing that it actually is setting the file time correctly, but Windows is displaying the time incorrectly, as a result of DST.

Maybe you could try moving the files to another computer (with a different version of windows) to see if another version of windows displays the time correctly. It's an odd issue, though.

Out of curiosity, why are you setting dates that are that far back in time?
Aren't you glad that I didn't put an annoying gif here?

arkazal
  • Guests
  • Last active:
  • Joined: --
Neat idea, and as you probably guessed, when I moved the file I changed the timestamp of on a Windows 7 machine to a Windows Vista machine, it displayed correctly without having to change it again. It's not Autohotkey, but rather, the way Windows 7 displays times due to Daylight Savings. Thanks for getting me to this conclusion, haha.

The times are all release dates :p

arkazal
  • Guests
  • Last active:
  • Joined: --
Oh, just one more kind of interesting thing: if I disable the automatic adjustment for Daylight Savings in the clock settings and then use the script, the correct time is displayed regardless of the date. Definitely Windows freaking 7 -__-

camerb
  • Moderators
  • 573 posts
  • Last active: Sep 14 2015 03:32 PM
  • Joined: 19 Mar 2009
Man, I'm sad to hear that. I wish there was some sort of a solution (even if it was a hack). Can't really change the OS, unfortunately. At least the problem is small, and only happens during half of the year. :-/
Aren't you glad that I didn't put an annoying gif here?