ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: MrWorldWide on May 15, 2022, 08:46:55 AM

Title: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: MrWorldWide on May 15, 2022, 08:46:55 AM
I'm able to see various dates in Exif data but only want to set CreateDate as FileCreateDate and ModifyDate as FileModifyDate for all *.mov files (from iphone 13) in a folder.


exiftool.exe -time:all -gl -a -s  IMG_5799.MOV
FileModifyDate                  : 2022:05:04 17:14:00+05:00
FileAccessDate                  : 2022:05:13 23:03:48+05:00
FileCreateDate                  : 2022:05:13 19:46:30+05:00
CreateDate                      : 2022:04:23 08:53:52
ModifyDate                      : 2022:04:23 08:53:57


I've tried several commands but can't seem to get it right.


exiftool.exe "-FileModifyDate<XMP:DateTimeOriginal" "-FileModifyDate<EXIF:CreateDate" "-FileModifyDate<EXIF:DateTimeOriginal" .\
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - ./IMG_5799.MOV
Warning: No writable tags set from ./IMG_5799.MOV
    1 directories scanned
    1 image files updated
    1 image files unchanged


Btw, images files in this folder are getting updated correctly, its only the mov files whose file date doesn't update.
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: MrWorldWide on May 15, 2022, 09:13:19 AM
Ok, This command worked to update all files in the folder


exiftool.exe "-FileCreateDate<CreateDate" "-FileModifyDate<ModifyDate" .


BUT, the CreateDate/ModifyDate times are in UTC and exiftool is setting that exact time as the file time, so now file times are showing in UTC. Whats the command to adjust for UTC?
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: StarGeek on May 15, 2022, 09:57:01 AM
Quote from: MrWorldWide on May 15, 2022, 09:13:19 AM
BUT, the CreateDate/ModifyDate times are in UTC and exiftool is setting that exact time as the file time, so now file times are showing in UTC. Whats the command to adjust for UTC?

Add the -api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC) and exiftool will adjust the time by the computer's set time zone.
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: MrWorldWide on May 15, 2022, 10:38:05 AM
Thanks, that worked!


exiftool.exe -api QuickTimeUTC=1 "-FileCreateDate<CreateDate" "-FileModifyDate<ModifyDate" ./*.mov


New issue. For part of my trip, I was near border and my phone connected with other country's celltower with different timezone and recorded around 30 images/movies with GMT+8 offset, instead of actual GMT+5. It's only happening in heic files (not mov). When I run the existing command, its showing the incorrect time (+3 hours ahead of actual time). How do fix that?


exiftool.exe -time:all -gl -a -s  IMG_6910.heic
FileModifyDate                  : 2022:04:25 16:52:21+05:00
FileAccessDate                  : 2022:05:15 18:21:41+05:00
FileCreateDate                  : 2022:04:25 16:52:21+05:00
ModifyDate                      : 2022:04:25 16:52:21
DateTimeOriginal                : 2022:04:25 16:52:21
CreateDate                      : 2022:04:25 16:52:21
OffsetTime                      : +08:00
OffsetTimeOriginal              : +08:00
OffsetTimeDigitized             : +08:00
SubSecTimeOriginal              : 308
SubSecTimeDigitized             : 308
GPSDateStamp                    : 2022:04:25
CreateDate                      : 2022:04:25 16:52:21
ModifyDate                      : 2022:04:25 16:52:21
DateCreated                     : 2022:04:25 16:52:21
ProfileDateTime                 : 2017:07:07 13:22:32
SubSecCreateDate                : 2022:04:25 16:52:21.308+08:00
SubSecDateTimeOriginal          : 2022:04:25 16:52:21.308+08:00
SubSecModifyDate                : 2022:04:25 16:52:21+08:00
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: MrWorldWide on May 15, 2022, 10:50:01 AM
Tried this command:


exiftool.exe -alldates-=1 -filemodifydate-=1 -filecreatedate-=3 ./IMG_6838.HEIC

exiftool.exe -time:all -gl -a -s  IMG_6836.heic
FileModifyDate                  : 2022:04:25 13:44:11+05:00
FileAccessDate                  : 2022:05:15 19:46:32+05:00
FileCreateDate                  : 2022:05:15 19:44:34+05:00
ModifyDate                      : 2022:04:25 13:44:11
DateTimeOriginal                : 2022:04:25 13:44:11
CreateDate                      : 2022:04:25 13:44:11
OffsetTime                      : +08:00
OffsetTimeOriginal              : +08:00
OffsetTimeDigitized             : +08:00
SubSecTimeOriginal              : 803
SubSecTimeDigitized             : 803
GPSDateStamp                    : 2022:04:25
ProfileDateTime                 : 2017:07:07 13:22:32
SubSecCreateDate                : 2022:04:25 13:44:11.803+08:00
SubSecDateTimeOriginal          : 2022:04:25 13:44:11.803+08:00
SubSecModifyDate                : 2022:04:25 13:44:11+08:00


But it shifts date, without changing timezone info in the pic? Also, its creating duplicate file (copy of original) instead of in-place update.
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: MrWorldWide on May 15, 2022, 11:19:16 AM
Finally fixed it:


exiftool.exe -overwrite_original "-OffsetTime*=+5:00" -alldates-=3 -filemodifydate-=3 -filecreatedate-=3 .


-overwrite_original = Overwrite original file
-OffsetTime*=+5:00 = Set all tags starting with OffsetTime to +5:00 timezone. Note that + is important or command will fail
Last three args are to adjust all times by 3 to bring it from 8 to 5 GMT offset.
Title: Re: Set mov/quicktime CreateDate as FileModifyDate in Windows?
Post by: StarGeek on May 15, 2022, 02:12:58 PM
Quote from: MrWorldWide on May 15, 2022, 11:19:16 AM
-OffsetTime*=+5:00 = Set all tags starting with OffsetTime to +5:00 timezone. Note that + is important or command will fail

Yes, time zones must be in the ±HH:MM (or Z for UTC) format.  See FAQ #5 (https://exiftool.org/faq.html#Q5) for details.