Image-ExifTool - Re: Problem Setting FileModifyDate

Posted on Thu Jul 17 03:41:42 2008 by exiftool in response to 8330 (See the whole thread of 26)
Re: Problem Setting FileModifyDate
Cool. PC's are wonderful. ;)

I've managed to reproduce your problem. The problem disappears if you turn off "Automatically adjust clock for daylight savings time" in your Date and Time settings. Maybe this is the best "solution" to the problem.

With this setting on, writing the FileModifyDate of "2007:03:25 18:35:16" results in a time that is 1 hour too late. And to be absolutely consistent in this inconsistency, subtracting an hour from this time does nothing (as you observed). This is because exiftool subtracts an hour but Windows adds it back again, so nothing is done. To actually subtract one hour from this time, you need to subtract two hours on the command line. Remember, I did say that PC's are wonderful!

I haven't looked at my code in detail, but I suspect there is nothing I can do to fix this. It is just some weird inconsistency in the way that daylight savings time is handled in your time zone. When I set my computer back to Eastern Daylight time, this problem does not occur on the day when daylight savings time started in this time zone (2007:03:11), except if I try to set an invalid time like 02:30:00. But this is to be expected because local time 02:30:00 doesn't exist on this day since the clocks here jump forward from 02:00:00 to 03:00:00 at the start of DST. For other times before 02:00:00 and after 03:00:00 on this date, the FileModifyDate can be set as expected.

In your time zone, the jump occurs from 01:00:00 to 02:00:00 on 2007:03:25, so setting times in this range will do funny things. But your times are around 18:00, so I don't see why there should be a problem, but there is.

- Phil
Direct Responses: 8347 | Write a response