Copying DateTimeOriginal to FileModifyDate drops the DST offset

Started by Exifdude, January 08, 2019, 04:26:14 PM

Previous topic - Next topic

Exifdude

I'm trying to update the FileModifyDate using the DateTimeOriginal on this type of JPG.  The two methods I have tried below remove the -01:00 UTC which is in effect due to Daylight Savings Time.  Is there anything that can be done to prevent this from happening?  If DTS is not in effect the value copies over fine.  With that being said a command that somehow arbitrarily adds an hour to the FileModifyDate wouldn't work in my case as this needs to be applied to files taken during and outside of DTS.

C:\Users\XYZ>exiftool -a -G1 -s -time:all E:\IMG_0001.JPG
[System]        FileModifyDate                  : 2019:07:08 16:45:52-04:00   <=Accurate hour due to DTS
[System]        FileAccessDate                  : 2019:01:08 00:00:00-05:00
[System]        FileCreateDate                  : 2019:01:08 16:07:39-05:00
[IFD0]          ModifyDate                      : 2019:07:08 15:45:50
[ExifIFD]       DateTimeOriginal                : 2019:07:08 15:45:50            <=DateTimeOriginal was taken in -05:00
[ExifIFD]       CreateDate                      : 2019:07:08 15:45:50

C:\Users\XYZ>exiftool "-filemodifydate<${DateTimeOriginal;s/ DST//}" -v "E:\IMG_0001.JPG"
======== E:\IMG_0001.JPG
Setting new values from E:\IMG_0001.JPG
    1 image files updated

C:\Users\XYZ>exiftool "-filemodifydate<datetimeoriginal" -v "E:\IMG_0001.JPG"
======== E:\IMG_0001.JPG
Setting new values from E:\IMG_0001.JPG
    1 image files updated

C:\Users\XYZ>exiftool -a -G1 -s -time:all E:\IMG_0001.JPG
[System]        FileModifyDate                  : 2019:07:08 15:45:50-04:00 <= Copies over as -05:00 thereby causing a difference of an hour from when the photo was originally taken
[System]        FileAccessDate                  : 2019:07:08 01:00:00-04:00
[System]        FileCreateDate                  : 2019:01:08 16:07:39-05:00
[IFD0]          ModifyDate                      : 2019:07:08 15:45:50
[ExifIFD]       DateTimeOriginal                : 2019:07:08 15:45:50
[ExifIFD]       CreateDate                      : 2019:07:08 15:45:50

StarGeek

Try the GlobalTimeShift option.  As an example, try
exiftool -globalTimeShift 1 "-filemodifydate<datetimeoriginal" E:\IMG_0001.JPG

Example output:
C:\>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal y:\!temp\Test4.jpg
---- System ----
FileModifyDate                  : 2019:07:08 16:45:52-07:00
---- ExifIFD ----
DateTimeOriginal                : 2019:07:08 15:45:50

C:\>exiftool -P -overwrite_original -globalTimeShift 1 "-filemodifydate<datetimeoriginal" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal y:\!temp\Test4.jpg
---- System ----
FileModifyDate                  : 2019:07:08 16:45:50-07:00
---- ExifIFD ----
DateTimeOriginal                : 2019:07:08 15:45:50


One thing to remember is that the System timestamps will automatically correct for time zones.  Those dates are controlled by the underlying OS. 
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Note there is a known "feature" (ie. bug) in the way that Windows handles time zones, mentioned in this post.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).