Hi, It’s not a Xojo problem.
A user of my synchronisation program submit me a trouble (sync between a Source and a Target folder).
He works on a Mac and on a PC Windows. He has his documents on a USB stick. He works on the PC on the USB stick and, when back at home, synchronize his USB stick with his Mac.
When he get the info of a file on the USB stick from his Mac, he obtains “Modification date 26/06/2014 12:14”. When he read it on Windows he read “Modification date 26/06/2014 11:14”. He got this trouble since the change for save Daylight.
I added a setting in my program to add an offset (1 hour in this case) when I read modification date from files on the Target folder. Because before that, all the files would have to be copied again (even if no change).
My question is, I didn’t reach to have an answer on Mac forums : Does a hard drive, an USB stick, etc. have an internal clock? If yes, does this clock automatically change when the offset (save daylight change) ?
Or does Windows or Mac OS X add an offset when it read a date-time of a file ?
I hope I’m clear, English is not my native language.
Thank you.
To my knowledge neither USB Flash Drives nor Hard Drives have any smarts about time. The file date (modified date, etc) and any other attributes are assigned by the operating system. It sounds one of the two operating systems (or both) is displaying it incorrectly. Below is a link related to this on the MAC (I am sure there is one for Windows as well).
[quote=142839:@Thomas ROBISSON]My question is, I didn’t reach to have an answer on Mac forums : Does a hard drive, an USB stick, etc. have an internal clock? If yes, does this clock automatically change when the offset (save daylight change) ?
Or does Windows or Mac OS X add an offset when it read a date-time of a file ?[/quote]
No, USB sticks or hard drives have no internal clock. The time stamp on files is created by the host system, Mac OS X or Windows. So if the time zone is set right, the time will adjust to daylight saving time (heure d’été) automatically.
Then I may not have understood what the guys explain :
He synchronized his USB stick with his Mac some days before the change of TimeOffset saging daylights. Each file on Source and Target had the same date.
Then he launched a synchronization some days after the hour change for saveDaylight, and the program indicate that all the files need to be copied. He didn’t sync them, he looked at the info and see that all the files had 1 hour difference!
Then who changed the time? I see one solution, maybe he has on his PC a software suppose to repair the bug (link from Thomas Eckert) and this soft change all the modification DateTime.
Thank you very much for your help. I often read those kind of trouble on the web when we change hour for save DayLight. I would like to understand.
And I read long time ago one guy answered to another one telling him the internal clock of his external hard drive had probem. That’s why I thought there was one.
Internet is full of ignorants who feel compelled to tell idiotic things. Even when using the cloud, which is after all on another system which has indeed it’s own clock, the date is preserved.
The story about the USB stick and the date change seems so strange, it would warrant verification. Your guy could have tried when he saw the alleged one hour difference to set the clock back and check again. But as usually in such a case, it is now quite unverifiable. Let him simply synchronize his USB stick again and stop bothering others with a few misplaced electrons. Possibly in his own brain
Thank you Michel. I added a feature in my programs because, as I said, he was not the first guy to ask me about this problem. But only 4 or 5 guys asked me about offset problem in 6 years.
As when I search on the web I found a lot of people on forum asking about similar problem, I thought it was a real problem.