CreationDate format with UTC/daylight saving time

Started by Fulco, May 22, 2019, 08:36:09 AM

Previous topic - Next topic

Fulco

Hello Phil,

Time zone with or without daylight saving time is not included in the creation date format with this command:

exiftool -api QuickTimeUTC "-CreationDate<FileName" -overwrite_original /Users/Fulco/Test/20190421130102.mov
    1 image files updated
exiftool -CreationDate /Users/Fulco/Test/20190421130102.mov
Creation Date                   : 2019:04:21 13:01:02


Still, I can achieve that by applying this command:

exiftool '-CreationDate<${FileName;s/^(\d{14}).*/$1+0200/}' -overwrite_original /Users/Fulco/Test/20190421130102.mov
    1 image files updated
exiftool -CreationDate /Users/Fulco/Test/20190421130102.mov
Creation Date                   : 2019:04:21 13:01:02+02:00


Can Exiftool also do this automatically without specifying yourself the time zone and eventual daylight saving time?

Regards,
Fulco

Phil Harvey

You want to add the time zone of the system at the specified date/time?  This is a bit tricky, but if you are willing to also set FileModifyDate, you could do this:

exiftool "-FileModifyDate<FileName" -execute -api QuickTimeUTC "-CreationDate<FileModifyDate" -overwrite_original -common_args /Users/Fulco/Test/20190421130102.mov

- 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 ($).

Fulco

Indeed, a bit tricky, but very helpful. Thanks again!

Regards,
Fulco

Hayo Baan

Just one observation: this will assume local time so the command will not work correctly for files taken in a different time zone from your own.

P.S. If you always want to have the -api QuickTimeUTC applied, you can add it to your .ExifTool_config. E.g. like so:

# Quicktime Date/Times are in UTC
$Image::ExifTool::UserDefined::Options{QuickTimeUTC} = 1;
Hayo Baan – Photography
Web: www.hayobaan.nl

Fulco