How to update all time metadata with file modify time?

Started by levid, October 08, 2018, 11:50:23 PM

Previous topic - Next topic

levid

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

Hayo Baan

Use
exiftool "-time:all<$FileModifyDate" -wm  w -P file
(replace double quotes with single quotes on a Mac/Linux)
Hayo Baan – Photography
Web: www.hayobaan.nl

levid

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

Phil Harvey

Add the -api quicktimeutc option when extracting.  See here for an explanation.

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

levid