Setup: I have a number of biometric devices, each of which records 24hr-48hr chunks of data that need to be correctly time-stamped with start date of each recording. Each device needs to be connected to a PC from time to time, at which point they function as removable storage media, allowing collected data to be downloaded. I have design control over the software (.NET) on the PC and some limited design control over the firmware on the device.
Problem: Each device keeps an internal date/time, and a clock battery keeps this clock working even when unpowered, but they are not intelligent to know anything about daylight saving time or time zones. As a result, this device sometimes gets out of sync and has to be manually reset. The physical design of the device prevents anything other than using the removable storage (an SD card) while it's connected to the PC—I cannot directly send commands to the device's main processor. Resolution down to the minute is good enough.
Possible Solution: While it's connected to a PC, the software could write the PC's local date/time to a file on the device's SD card, and the next time the device starts up, it could read that file and use that to set it's internal date/time. However, if the device isn't immediately powered back on by a user (and there's no way to enforce that) the date/time that was written to the card will be off by minutes to days. What I really need to know is the current internal date/time on the device at the instant it starts up in USB mode as well as the local date/time on the PC when the device was connected (let's assume these happen within a minute of each other). The software can then write out the delta to the SD card, and the device can use that delta to adjust the internal date/time to the device. This would also address the situations when the device is left unpowered for days.
Question: Has anyone else had to deal with this kind of situation, and if so, am I going about this in the right way? Does anyone have any alternative suggestions or are there any pitfalls I need to watch out for with the proposed implementation?