2

when i take a picture and put the sdcard in my Ubuntu 18.10, the picture date is 6-hrs ago. but if i look at it in my panasonic camera, the time is correct. if i look at it in windows, the time is correct. if i try a different camera, a canon, and different sdcard, same thing, 6-hrs earlier. date and time on Ubuntu is correct. date and time on the cameras are correct. i tried formatting the sdcards. what's going on?

this picture was taken at 8:03pm, but properties says modified at 2:03pm, exif data says correctly 8:03pm.
screenshot

My time zone is CST, central.

  • What's your local time zone? – Kulfy Dec 1 '18 at 2:40
  • CST, central. i double-checked that setting – ticotexas Dec 1 '18 at 4:33
2

The FAT filesystem does not store the timezone, and the specification does not say whether timestamps should be taken as UTC (as on any other filesystem) or as local time. Windows interprets timestamps on FAT filesystems as being in the current local timezone. Linux, by default, interprets them as UTC.

Example: The timestamp on the file says 8:03. Linux believes this to be UTC. Your local timezone is 6 hours behind (that is, west of) UTC, so Linux displays this as 2:03 local time.

Mount the filesystem with -o time_offset=-360 to tell the kernel that timestamps on the FAT filesystem are to be considered 6 hours behind UTC. See the manual page of the mount command for details.

  • thanks, makes sense now. but the sdcard seems to automount when it is inserted. do i need to mount it again elsewhere with the time_offset each time i insert it? or is there a way to make the time_offset permanent? – ticotexas Dec 1 '18 at 18:04
  • @ticotexas: Yep. sudo umount /dev/sdb1 && sudo mount -o uid=$(id -u),gid=$(id -g),quiet,fmask=0133,dmask=0022,time_offset=-360 /dev/sdb1 /mnt should do the trick. Replace /dev/sdb1 as needed and /mnt according to taste. If your locale has daylight saving time then when daylight saving time is in effect you may want to replace -360 with -300. Remember to sudo umount /dev/sdb1 before removing the card. – AlexP Dec 1 '18 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.