mayhem-firmware
mayhem-firmware copied to clipboard
File time stamps are not adjusted for DST
Describe the bug.
File modification time/date is not being updated for DST.
Reproduction
- Set clock and enable DST so that time is advanced by 1 hour.
- Modify a file.
- Look at file time stamp in File Manager.
Expected behavior
I think the time shown in File Manager should match the time displayed on the screen (DST-adjusted time).
Questions:
- Not sure if File Manager should adjust the time values displayed (presumably adding an hour during the date range configured for DST), or if the date & time actually stored in the file info should be DST-adjusted time (would need to modify chbios get_fatttime() or rtcGetTimeFat() functions).
- It seems that in most OS's the file time stamp is in UTC and the displayed date & time is modified (only when viewed) according to time zone and DST.
- Perhaps we should do similar and add a time zone setting to pmem, and use UTC time in the RTC.
- Existing PortaPack users may indeed choose to set the RTC to UTC time on Portapack but in that case they should know not to enable DST (firmware currently has no time zone support for converting UTC to local time; it can only adjust time by 1 hour for DST).
- File time stamps need to be correct in SD-over-USB mode and when the SD card is plugged into a computer too.
More investigation is needed to determine how to proceed on this one.
Environment/versions
No response
Anything else?
No response