ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: levid on October 08, 2018, 11:50:23 PM

Title: How to update all time metadata with file modify time?
Post by: levid on October 08, 2018, 11:50:23 PM
I want to update all time metadata with file modify time, but don't know how to write the file modify time into the command line.

exiftool -time:all="FileModifyDate" -wm  w -P file
The above command line doesn't work.

Here is my file informaiton. I want to change every time label to FileModifyDate, in this file it is '2018:02:08 21:04:08+08:00'.
exiftool  -time:all -g1 -a -s IMG_1531.mp4
---- System ----
FileModifyDate                  : 2018:02:08 21:04:08+08:00
FileAccessDate                  : 2018:10:09 11:29:28+08:00
FileCreateDate                  : 2018:10:09 10:20:10+08:00
---- QuickTime ----
CreateDate                      : 2018:10:09 11:27:55
ModifyDate                      : 2018:10:09 11:27:55
---- Track1 ----
TrackCreateDate                 : 2018:10:09 11:27:55
TrackModifyDate                 : 2018:10:09 11:27:55
MediaCreateDate                 : 2018:10:09 11:27:55
MediaModifyDate                 : 2018:10:09 11:27:55
---- Track2 ----
TrackCreateDate                 : 2018:10:09 11:27:55
TrackModifyDate                 : 2018:10:09 11:27:55
MediaCreateDate                 : 2018:10:09 11:27:55
MediaModifyDate                 : 2018:10:09 11:27:55
Title: Re: How to update all time metadata with file modify time?
Post by: Hayo Baan on October 09, 2018, 02:29:47 AM
Use
exiftool "-time:all<$FileModifyDate" -wm  w -P file
(replace double quotes with single quotes on a Mac/Linux)
Title: Re: How to update all time metadata with file modify time?
Post by: levid on October 09, 2018, 02:45:11 AM
Thanks, it works. But the metadata times are all in UTC time zone as follow. Is it possible to add time zone info to metadata time?

======== IMG_1531.mp4
---- System ----
FileModifyDate                  : 2018:02:08 21:04:08+08:00
FileAccessDate                  : 2018:10:09 14:41:53+08:00
FileCreateDate                  : 2018:02:08 21:04:08+08:00
---- QuickTime ----
CreateDate                      : 2018:02:08 21:04:08
ModifyDate                      : 2018:02:08 21:04:08
---- Track1 ----
TrackCreateDate                 : 2018:02:08 21:04:08
TrackModifyDate                 : 2018:02:08 21:04:08
MediaCreateDate                 : 2018:02:08 21:04:08
MediaModifyDate                 : 2018:02:08 21:04:08
---- Track2 ----
TrackCreateDate                 : 2018:02:08 21:04:08
TrackModifyDate                 : 2018:02:08 21:04:08
MediaCreateDate                 : 2018:02:08 21:04:08
MediaModifyDate                 : 2018:02:08 21:04:08
Title: Re: How to update all time metadata with file modify time?
Post by: Phil Harvey on October 09, 2018, 07:11:26 AM
Add the -api quicktimeutc option when extracting.  See here (https://exiftool.org/ExifTool.html#QuickTimeUTC) for an explanation.

- Phil
Title: Re: How to update all time metadata with file modify time?
Post by: levid on October 09, 2018, 10:46:09 AM
Phil, thanks. It works very well.