I have thousands of videos with scrambled creation dates, and their names include the date.(ex:2020-01-01-010101)
I fixed the dates with the following commands
exiftool "-filemodifydate<filename" "-createdate<filename" "-FileCreateDate<filename" DIR
The files were successfully modified, but something went wrong.
I live in South Korea, which means I'm in the UTC+9 timezone.
And I noticed that the creation dates of the files are all 9 hours behind. For example, if the filename is 20250101-040404, the creation date of the file is modified to 20250101-130404.
Is there any alternative or way around this?
Translated with DeepL.com (free version)
You left out some important information:
1) What system are you using?
2) What time zone is your system set to?
3) How are you reading back the "Creation Date"? (And with what system, filesystem and time zone setting?)
4) What type of files are these? (JPG or MOV/MP4?)
Also, it would be useful to read back the information using ExifTool:
exiftool -G1 -a -s -time:all FILE
- Phil
The CreateDate tag in videos needs to be set to UTC. The command you are using sets it to the Local Time as if it was UTC. In other words, it is writing the time as 2020:01:01 01:01:01 when it should be written as 2019:12:31 16:01:01 for a +09:00 time zone.
Try adding the -api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC). That will automatically adjust the time to UTC.
Still, it appears 9 hours later even though i used -api option.
1) MacOS 15, but same problem happens in Windows too.
2) My system time is set to UTC +09:00
3) I don't understand the question, i am reading back creation date by filename.
4) MOV n MP4.
Quote from: accforexif on March 18, 2025, 12:32:44 PMAnd I noticed that the creation dates of the files are all 9 hours behind. For example, if the filename is 20250101-040404, the creation date of the file is modified to 20250101-130404.
What program are you using to see this "creation date"?
What is the output of the command Phil listed?
Quote from: StarGeek on March 18, 2025, 08:03:24 PMQuote from: accforexif on March 18, 2025, 12:32:44 PMAnd I noticed that the creation dates of the files are all 9 hours behind. For example, if the filename is 20250101-040404, the creation date of the file is modified to 20250101-130404.
What program are you using to see this "creation date"?
What is the output of the command Phil listed?
Windows basic explorer and Synology Photos, boths display same date, which is 9 hours later from filename.
Quote from: Phil Harvey on March 18, 2025, 12:48:06 PMYou left out some important information:
1) What system are you using?
2) What time zone is your system set to?
3) How are you reading back the "Creation Date"? (And with what system, filesystem and time zone setting?)
4) What type of files are these? (JPG or MOV/MP4?)
Also, it would be useful to read back the information using ExifTool:
exiftool -G1 -a -s -time:all FILE
- Phil
here's the output of your command. that is one of my video.
2025-03-16-19-08-04.mov
[System] File Modification Date/Time : 2025:03:16 19:08:04+09:00
[System] File Access Date/Time : 2025:03:19 13:15:38+09:00
[System] File Inode Change Date/Time : 2025:03:19 13:14:37+09:00
[QuickTime] Create Date : 2025:03:16 19:08:04
[QuickTime] Modify Date : 2025:03:16 19:08:04
[Track1] Track Create Date : 2025:03:18 14:49:34
[Track1] Track Modify Date : 2025:03:18 14:49:35
[Track1] Media Create Date : 2025:03:18 14:49:34
[Track1] Media Modify Date : 2025:03:18 14:49:35
[Track2] Track Create Date : 2025:03:18 14:49:34
[Track2] Track Modify Date : 2025:03:18 14:49:35
[Track2] Media Create Date : 2025:03:18 14:49:34
[Track2] Media Modify Date : 2025:03:18 14:49:35
[XMP-exif] Date/Time Original : 2025:03:16 19:08:04
[XMP-xmp] Create Date : 2025:03:16 19:08:04
[XMP-xmp] Modify Date : 2025:03:16 19:08:04
[UserData] Date/Time Original : 2025:03:16 19:08:04+09:00
Using your original command and adding the -api QuickTimeUTC should work.
Example on my system, -07:00 time zone
C:\>exiftool -P -overwrite_original -api QuickTimeUTC "-filemodifydate<filename" "-createdate<filename" "-FileCreateDate<filename" Y:\!temp\x\y\2025-03-16-19-08-04.mp4
1 image files updated
C:\>exiftool -time:all -G1 -a -s Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 19:08:04-07:00
[System] FileAccessDate : 2025:03:16 19:08:04-07:00
[System] FileCreateDate : 2025:03:16 19:08:04-07:00
[QuickTime] CreateDate : 2025:03:17 02:08:04
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
The FileModifyDate is set to the exact time from the filename. The Quicktime:CreateDate is set to the UTC time, 7 hours ahead of my local time.
If I use the -api TimeZone option (https://exiftool.org/ExifTool.html#TimeZone) to temporarily set the time to KST (which would be done as KST-9 on Windows, but I think would be Asia/Seoul on Mac/Linux), I get the correct UTC time for +09:00 time zone
C:\>exiftool -P -overwrite_original -api timezone=KST-9 -api QuickTimeUTC "-filemodifydate<filename" "-createdate<filename" "-FileCreateDate<filename" Y:\!temp\x\y\2025-03-16-19-08-04.mp4
1 image files updated
C:\>exiftool -time:all -G1 -a -s Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 03:08:04-07:00
[System] FileAccessDate : 2025:03:16 03:08:04-07:00
[System] FileCreateDate : 2025:03:16 03:08:04-07:00
[QuickTime] CreateDate : 2025:03:16 10:08:04
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
Running the -Time:all command with the -api timezone=KST-9 and -api QuickTimeUTC shows the correct results for your time zone. The file system time stamps are further adjusted
C:\>exiftool -time:all -G1 -a -s -api timezone=KST-9 -api QuickTimeUTC Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 19:08:04+09:00
[System] FileAccessDate : 2025:03:19 13:29:48+09:00
[System] FileCreateDate : 2025:03:16 19:08:04+09:00
[QuickTime] CreateDate : 2025:03:16 19:08:04+09:00
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
Quote from: StarGeek on March 19, 2025, 12:43:27 AMUsing your original command and adding the -api QuickTimeUTC should work.
Example on my system, -07:00 time zone
C:\>exiftool -P -overwrite_original -api QuickTimeUTC "-filemodifydate<filename" "-createdate<filename" "-FileCreateDate<filename" Y:\!temp\x\y\2025-03-16-19-08-04.mp4
1 image files updated
C:\>exiftool -time:all -G1 -a -s Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 19:08:04-07:00
[System] FileAccessDate : 2025:03:16 19:08:04-07:00
[System] FileCreateDate : 2025:03:16 19:08:04-07:00
[QuickTime] CreateDate : 2025:03:17 02:08:04
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
The FileModifyDate is set to the exact time from the filename. The Quicktime:CreateDate is set to the UTC time, 7 hours ahead of my local time.
If I use the -api TimeZone option (https://exiftool.org/ExifTool.html#TimeZone) to temporarily set the time to KST (which would be done as KST-9 on Windows, but I think would be Asia/Seoul on Mac/Linux), I get the correct UTC time for +09:00 time zone
C:\>exiftool -P -overwrite_original -api timezone=KST-9 -api QuickTimeUTC "-filemodifydate<filename" "-createdate<filename" "-FileCreateDate<filename" Y:\!temp\x\y\2025-03-16-19-08-04.mp4
1 image files updated
C:\>exiftool -time:all -G1 -a -s Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 03:08:04-07:00
[System] FileAccessDate : 2025:03:16 03:08:04-07:00
[System] FileCreateDate : 2025:03:16 03:08:04-07:00
[QuickTime] CreateDate : 2025:03:16 10:08:04
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
Running the -Time:all command with the -api timezone=KST-9 and -api QuickTimeUTC shows the correct results for your time zone. The file system time stamps are further adjusted
C:\>exiftool -time:all -G1 -a -s -api timezone=KST-9 -api QuickTimeUTC Y:\!temp\x\y\2025-03-16-19-08-04.mp4
[System] FileModifyDate : 2025:03:16 19:08:04+09:00
[System] FileAccessDate : 2025:03:19 13:29:48+09:00
[System] FileCreateDate : 2025:03:16 19:08:04+09:00
[QuickTime] CreateDate : 2025:03:16 19:08:04+09:00
[QuickTime] ModifyDate : 0000:00:00 00:00:00
<snip...>
finally it works! it didn't work because i used -api quicktimeutc with " ". thank you!