This post was drafted by me and grammatically checked by ChatGPT.

Intro

I own a Fujifilm XT-20, a camera renowned for its quality, though it has a rather simplistic approach to managing timezones. It allows you to set the datetime for your current location and provides an option to adjust the datetime offset based on your travel destination relative to your home timezone.

However, I’ve encountered an issue when uploading photos taken with the XT-20 to Google Photos: the timestamps often disrupt the chronological order of my photo stream, requiring me to correct each photo individually—a tedious process.

This led me to ponder the discrepancy in how photos from my iPhone are perfectly timed and placed upon upload, as opposed to those from my XT-20.

Analysis

To understand this difference, I used ExifTool to examine the metadata of photos taken by both devices:

$ exiftool -time:all -G1 -a -as  ./xt20photo.JPG

[System]        File Modification Date/Time     : 2024:04:04 21:22:32+01:00
[System]        File Access Date/Time           : 2024:04:04 21:22:34+01:00
[System]        File Inode Change Date/Time     : 2024:04:04 21:22:32+01:00
[IFD0]          Modify Date                     : 2024:04:02 16:47:04
[ExifIFD]       Date/Time Original              : 2024:04:02 16:47:04
[ExifIFD]       Create Date                     : 2024:04:02 16:47:04

$ exiftool -time:all -G1 -a -as  ./iphonephoto.jpeg 

[System]        File Modification Date/Time     : 2024:04:04 20:26:48+01:00
[System]        File Access Date/Time           : 2024:04:04 20:26:58+01:00
[System]        File Inode Change Date/Time     : 2024:04:04 20:26:56+01:00
[IFD0]          Modify Date                     : 2024:04:02 17:42:04
[ExifIFD]       Date/Time Original              : 2024:04:02 17:42:04
[ExifIFD]       Create Date                     : 2024:04:02 17:42:04
[ExifIFD]       Offset Time                     : +02:00
[ExifIFD]       Offset Time Original            : +02:00
[ExifIFD]       Offset Time Digitized           : +02:00
[ExifIFD]       Sub Sec Time                    : 856
[ExifIFD]       Sub Sec Time Original           : 856
[ExifIFD]       Sub Sec Time Digitized          : 856
[GPS]           GPS Time Stamp                  : 15:42:04
[GPS]           GPS Date Stamp                  : 2024:04:02
[ICC-header]    Profile Date Time               : 2022:01:01 00:00:00
[Composite]     Create Date                     : 2024:04:02 17:42:04.856+02:00
[Composite]     Date/Time Original              : 2024:04:02 17:42:04.856+02:00
[Composite]     Modify Date                     : 2024:04:02 17:42:04.856+02:00
[Composite]     GPS Date/Time                   : 2024:04:02 15:42:04Z

From my analysis, it became apparent that the XT-20 does not save timezone information when capturing photos. It merely records the time as set by the user (in my case, set to +1 timezone), whereas my photos taken with an iPhone include detailed timezone information, reflecting the actual timezone where the photo was taken (+2).

Here’s the breakdown:

  • 15:42:04 [UTC]
  • 16:47:04 [+1] shot by XT-20
  • 17:42:04.856+02:00 [+2] shot by iPhone, with timezone info

Resolve

To resolve this, I decided to:

  1. Subtract 5 minutes for accuracy (from all timestamps).
  2. Add UTC time and timezone information to the EXIF (ExifIFD, Composite, and GPS sections).
  3. Adjust the Date/Time Original and Create Date to match the actual local time (in the ExifIFD section).

The following command was used:

$ exiftool 
  -OffsetTimeOriginal='+02:00' 
  -OffsetTimeDigitized='+02:00' 
  -OffsetTime='+02:00' 
  '-DateTimeOriginal<${DateTimeOriginal}+02:00' 
  '-CreateDate<${DateTimeOriginal}+02:00' 
  '-ModifyDate<${DateTimeOriginal}+02:00' 
  '-GPSTimeStamp<${DateTimeOriginal}+01:05' 
  '-GPSDateStamp<${DateTimeOriginal}+01:05' 
  -AllDates+=0:55 
  ./xt20photo.JPG -o ./xt20photoTZ.JPG

Setting the Offset of Timezone

  • OffsetTimeOriginal
  • OffsetTimeDigitized,
  • OffsetTime

These options adjust the photo’s metadata to reflect the real local time.

Shifting Time with Timezone

  • DateTimeOriginal
  • CreateDate
  • ModifyDate

These fields are updated based on the DateTimeOriginal with the correct timezone offset applied (2024:04:02 16:47:04+02:00), effectively shifting the time by 55 minutes to match the real local time after considering the timezone difference.

Setting UTC Time

  • GPSTimeStamp
  • GPSDateStamp

These options roll back the time by 1 hour (minus 5 minutes) to set the correct UTC time based on the original timestamp, adjusting for the timezone shift.

Fixed

After applying these changes, the metadata for a photo fixed with ExifTool looks like this:

# Photo by XT-20 fixed with ExifTool
$ exiftool -time:all -G1 -a -as  ./xt20photoTZ.JPG

[System]        File Modification Date/Time     : 2024:04:05 00:11:17+01:00
[System]        File Access Date/Time           : 2024:04:05 00:11:17+01:00
[System]        File Inode Change Date/Time     : 2024:04:05 00:11:17+01:00
[IFD0]          Modify Date                     : 2024:04:02 17:42:05
[ExifIFD]       Date/Time Original              : 2024:04:02 17:42:05
[ExifIFD]       Create Date                     : 2024:04:02 17:42:05
[ExifIFD]       Offset Time                     : +02:00
[ExifIFD]       Offset Time Original            : +02:00
[ExifIFD]       Offset Time Digitized           : +02:00
[GPS]           GPS Time Stamp                  : 15:42:05
[GPS]           GPS Date Stamp                  : 2024:04:02
[Composite]     Create Date                     : 2024:04:02 17:42:05+02:00
[Composite]     Date/Time Original              : 2024:04:02 17:42:05+02:00
[Composite]     Modify Date                     : 2024:04:02 17:42:05+02:00
[Composite]     GPS Date/Time                   : 2024:04:02 15:42:05Z

This method ensures that the datetime metadata matches that of iPhone photos closely. Now, when uploading to Google Photos, the timestamps align correctly.

Case example

Case above

  • Camera timezone: +1
  • Local timezone: +2
  • Need substract 5 minutes
  • For shift: 2:00 (local TZ) - 1:00 (camera TZ) - 0:05 (substract 5 minutes) = +0:55
  • For UTC: -1 * ( 0:00 (UTC) - 1:00 (camera TZ) - 0.05 (substract 5 minutes) ) = +1:05
$ exiftool 
  -OffsetTimeOriginal='+02:00' 
  -OffsetTimeDigitized='+02:00' 
  -OffsetTime='+02:00' 
  '-DateTimeOriginal<${DateTimeOriginal}+02:00' 
  '-CreateDate<${DateTimeOriginal}+02:00' 
  '-ModifyDate<${DateTimeOriginal}+02:00' 
  '-GPSTimeStamp<${DateTimeOriginal}+01:05' 
  '-GPSDateStamp<${DateTimeOriginal}+01:05' 
  -AllDates+=0:55 
  ./origin.jpeg -o ./fixed.jpeg

Other case 1

  • Camera timezone: +0
  • Local timezone: +0
  • Need substract 5 minutes
  • For shift: 0:00 (local TZ) - 0:00 (camera TZ) - 0:05 (substract 5 minutes) = -0:05
  • For UTC: -1 * ( 0:00 (UTC) - 0:00 (camera TZ) - 0.05 (substract 5 minutes) ) = +0:05
$ exiftool 
  -OffsetTimeOriginal='+00:00' 
  -OffsetTimeDigitized='+00:00' 
  -OffsetTime='+00:00' 
  '-DateTimeOriginal<${DateTimeOriginal}+00:00' 
  '-CreateDate<${DateTimeOriginal}+00:00' 
  '-ModifyDate<${DateTimeOriginal}+00:00' 
  '-GPSTimeStamp<${DateTimeOriginal}+00:05' 
  '-GPSDateStamp<${DateTimeOriginal}+00:05' 
  -AllDates-=0:05 
  ./origin.jpeg -o ./fixed.jpeg

Other case 2

  • Camera timezone: +1
  • Local timezone: +0
  • Need substract 5 minutes
  • For shift: 0:00 (local TZ) - 1:00 (camera TZ) - 0:05 (substract 5 minutes) = -1:05
  • For UTC: -1 * ( 0:00 (UTC) - 1:00 (camera TZ) - 0.05 (substract 5 minutes) ) = +1:05
$ exiftool 
  -OffsetTimeOriginal='+00:00' 
  -OffsetTimeDigitized='+00:00' 
  -OffsetTime='+00:00' 
  '-DateTimeOriginal<${DateTimeOriginal}+00:00' 
  '-CreateDate<${DateTimeOriginal}+00:00' 
  '-ModifyDate<${DateTimeOriginal}+00:00' 
  '-GPSTimeStamp<${DateTimeOriginal}+01:05' 
  '-GPSDateStamp<${DateTimeOriginal}+01:05' 
  -AllDates-=1:05 
  ./origin.jpeg -o ./fixed.jpeg

Other case 3

  • Camera timezone: +1
  • Local timezone: +1
  • Need substract 5 minutes
  • For shift: 1:00 (local TZ) - 1:00 (camera TZ) - 0:05 (substract 5 minutes) = -0:05
  • For UTC: -1 * ( 0:00 (UTC) - 1:00 (camera TZ) - 0.05 (substract 5 minutes) ) = +1:05
$ exiftool 
  -OffsetTimeOriginal='+01:00' 
  -OffsetTimeDigitized='+01:00' 
  -OffsetTime='+01:00' 
  '-DateTimeOriginal<${DateTimeOriginal}+01:00' 
  '-CreateDate<${DateTimeOriginal}+01:00' 
  '-ModifyDate<${DateTimeOriginal}+01:00' 
  '-GPSTimeStamp<${DateTimeOriginal}+01:05' 
  '-GPSDateStamp<${DateTimeOriginal}+01:05' 
  -AllDates-=0:05 
  ./origin.jpeg -o ./fixed.jpeg