Canon 7D wrong time on USB Connect

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
mike acker
Level 7
Level 7
Posts: 1517
Joined: Wed Jul 31, 2013 6:29 pm
Location: Kalamazoo, MI

Canon 7D wrong time on USB Connect

Post by mike acker »

I'm using a Canon 7D Mk.II now

if I connect it with the USB cable all the files come across with the wrong time-stamp

specifically : 4 hours are deducted

e.g. if I shoot a picture at 13:07, the data imported from the SD chip will appear as

Code: Select all

SD CHIP:
-rw-r--r-- 1 mike mike 11235586 2015-10-29 13:07:14.000000000 -0400 VM2A3123.JPG
while the data on the file imported from the USB tether will be

Code: Select all

Tether:
-rw-r--r-- 1 mike mike 11235586 2015-10-29 09:07:14.000000000 -0400 VM2A3123.JPG
it appears that Linux thinks the input data is at UTC rather than EDT -- and corrects the time stamps to local time

note: the 14 seconds indicate data taken from the file name -- not from the EXIF data -- which would show 13 seconds .

this could be
  • because the camera didn't specify the time zone associated with the data and Linux defaults it to UTC; or
  • because the camera specified that the files have UTC time when in fact they do not ( the time zone in the camera is set to EDT )
it runs in the back of my mind ( from my days working on DataGate ) that it is normal for Unix/Linux systems to provide time correction in system to system transfers. On the Windows computer the camera presents as a Camera Device -- not as a USB type file device .

any clues on this ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
¡Viva la Resistencia!
mike acker
Level 7
Level 7
Posts: 1517
Joined: Wed Jul 31, 2013 6:29 pm
Location: Kalamazoo, MI

Re: Canon 7D wrong time on USB Connect

Post by mike acker »

script for fixing files:

Code: Select all

#!/bin/sh
#
# reset jpeg file by 4 hours
#
echo "correct *.JPG time stamps.   Enter hours, e.g. +4 for UTC to EDT"
read hrs_adj
echo "Adjustment will be " $hrs_adj " hours. "

read -p "Enter name of directory to be corrected" directory_name

echo "Directory name: " $directory_name

 for file_nm in "$directory_name"/*.JPG
  do
    echo "File name to touch: " "$file_nm"  
    # to increment time stamp relative to subject file
    touch -r "$file_nm" -d " $hrs_adj hour " "$file_nm"
  done
  
  echo "Corrected Directory:"
  ls -l "$directory_name"

echo 'done'
if appears to me that the camera mounts as a device "photog" rather than as a fat32 file system. *apparently* this "photog" thing doesn't signal Linux properly that the files are in local time. dunno for sure but this is my best guess.
¡Viva la Resistencia!
Locked

Return to “Chat about Linux”