Hello. I have a Canon 70D digital camera and the time is set correctly and the timezone is set to UTC -5:00 which is New York time. For some reason when I copied the files to Linux, an additional 5 hours was subtracted from the file modified time and now all of the files I pulled from the camera show a modified date that is 5 hours too early (they are all now UTC -10:00). I verified that this does not happen when I copy the files from the camera SD card to a Windows directory. For some reason this problem does not occur on Windows.
I figured out how to use âtouchâ to add 5 hours back to the modified date on these files so they can be corrected but I would like to know how to prevent this from happening in the first place. This doesnât happen if I copy from the SD card to Mac, either.
I think the issue may be related to my Fedora using UTC time and somehow âdouble adjustingâ what it reads from the Camera SD card data by 5 hours and then another 5 hours.
I think this may be related to the time setting within both windows and fedora.
It is quite common for windows to cause this type situation.
In fedora run timedatectl and show us the result.
It should show something like this.
(mine is CST and yours is EST but that should be then only difference)
$ timedatectl
Local time: Sun 2025-02-16 20:32:07 CST
Universal time: Mon 2025-02-17 02:32:07 UTC
RTC time: Mon 2025-02-17 02:32:06
Time zone: America/Chicago (CST, -0600)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Note that RTC is set to UTC
RTC is the time set in bios.
Windows often uses an RTC that is set to local time so it causes this type error.
To fix it, first ensure the rtc is set to utc. Then ensure fedora displays the date/time correctly
Finally boot back into windows and make sure the date/time settings are proper there.
Once both are properly in sync then this problem should disappear.
If you copy directly from the cd-card you have to deal with the file timestamps. It appears that linux expects the timestamps to be in UTC time, but that can changed by the options
tz=UTC
This option disables the conversion of timestamps between local time (as used by Windows on FAT) and UTC (which Linux
uses internally). This is particularly useful when mounting devices (like digital cameras) that are set to UTC in
order to avoid the pitfalls of local time.
time_offset=minutes
Set offset for conversion of timestamps from local time used by FAT to UTC. I.e., minutes will be subtracted from each
timestamp to convert it to UTC used internally by Linux. This is useful when the time zone set in the kernel via
settimeofday(2) is not the time zone used by the filesystem. Note that this option still does not provide correct time
stamps in all cases in presence of DST - time stamps in a different DST setting will be off by one hour.
The option âtz=UTCâ seems to be default, so you should try the âtime_offsetâ option.