ExifTool Forum

ExifTool => Newbies => Topic started by: Fulco on May 22, 2019, 08:36:09 AM

Title: CreationDate format with UTC/daylight saving time
Post by: Fulco on May 22, 2019, 08:36:09 AM
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
Title: Re: CreationDate format with UTC/daylight saving time
Post by: Phil Harvey on May 22, 2019, 08:45:43 AM
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
Title: Re: CreationDate format with UTC/daylight saving time
Post by: Fulco on May 22, 2019, 08:51:47 AM
Indeed, a bit tricky, but very helpful. Thanks again!

Regards,
Fulco
Title: Re: CreationDate format with UTC/daylight saving time
Post by: Hayo Baan on May 22, 2019, 08:53:16 AM
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;
Title: Re: CreationDate format with UTC/daylight saving time
Post by: Fulco on May 22, 2019, 08:56:48 AM
I will try that! Thanks Hayo!