EXIF date 66 years in the past.

Kent - July 26, 2023

Lately, I’ve been importing 20 years of photos into iCloud, both as 3-2-1 backup, and to be able to access old photos on my phone from wherever I am.

There were no problems with most photos and videos, but with some videos from 1 type of phone (HTC One X), the EXIF data was wrong by 66 years into the past. A video taken in 2012, had the year set to 1946. Due to the chronographic nature of iOS/MacOS Photos, they popped into the front before everything else.

Screenshots showing the wrong year.

Alt text

And a screenshot of the file modification timestamp.

Alt text

Only a difference of 66 years…

Fortunately there is a tool called exiftool. It can show all timestamps embedded into the video itself, and the file timestamps. With a normal invocation, it will show the “correct” timestamp, because it knows some cameras and phones did not adhere to the QuickTime EXIF specification.

> exiftool -time:all -a -G0:1 VIDEO0001.mp4
[File:System]   File Modification Date/Time     : 2012:05:10 18:35:28+02:00
[File:System]   File Access Date/Time           : 2023:07:26 20:16:17+02:00
[File:System]   File Inode Change Date/Time     : 2012:05:10 18:35:28+02:00
[QuickTime]     Create Date                     : 2012:05:10 16:35:28
[QuickTime]     Modify Date                     : 2012:05:10 16:35:28
[QuickTime:Track1] Track Create Date            : 2012:05:10 16:35:28
[QuickTime:Track1] Track Modify Date            : 2012:05:10 16:35:28
[QuickTime:Track1] Media Create Date            : 2012:05:10 16:35:28
[QuickTime:Track1] Media Modify Date            : 2012:05:10 16:35:28
[QuickTime:Track2] Track Create Date            : 2012:05:10 16:35:28
[QuickTime:Track2] Track Modify Date            : 2012:05:10 16:35:28
[QuickTime:Track2] Media Create Date            : 2012:05:10 16:35:28
[QuickTime:Track2] Media Modify Date            : 2012:05:10 16:35:28

When we force QuickTimeUTC=1 witht -api QuickTimeUTC=1, it will show the same information as the Photos app and the file properties.

> exiftool -time:all -a -G0:1 -api QuickTimeUTC=1 VIDEO0001.mp4
[File:System]   File Modification Date/Time     : 2012:05:10 18:35:28+02:00
[File:System]   File Access Date/Time           : 2023:07:26 20:16:17+02:00
[File:System]   File Inode Change Date/Time     : 2012:05:10 18:35:28+02:00
[QuickTime]     Create Date                     : 1946:05:10 17:35:28+01:00
[QuickTime]     Modify Date                     : 1946:05:10 17:35:28+01:00
[QuickTime:Track1] Track Create Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track1] Track Modify Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track1] Media Create Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track1] Media Modify Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track2] Track Create Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track2] Track Modify Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track2] Media Create Date            : 1946:05:10 17:35:28+01:00
[QuickTime:Track2] Media Modify Date            : 1946:05:10 17:35:28+01:00

How to fix EXIF-data with exiftool.

exiftool can also fix (edit) EXIF-data. There are many commands and switches available, but here is the command that worked for me. All files had the original file modification date, so I could just reuse that.

The command I used was this;

exiftool -overwrite_original \
  -api QuickTimeUTC=1 \
  "-AllDates<FileModifyDate" \
  -P \
  VIDEO0*

After deleting and re-importing the files into iCloud, they are more current than 1946.

66 years in the past.

The QuickTime date/time-specification use 1904 as year 0, while brain-dead software use 1970 as year 0.

See Also

Comments

Any comments? Create a new discussion on GitHub.
There used to be an inline comment form here, but it was removed.