Copying timezone from XMP to EXIF

Started by José Oliver-Didier, May 10, 2023, 01:54:06 PM

Previous topic - Next topic

José Oliver-Didier

Hello,

How can I set the 3 EXIF timezone offset values (OffsetTime, OffsetTimeOriginal, OffsetTimeDigitized) using the XMP timezone value in the XMP Date/Time Digitized, if available?

[XMP-exif]      Date/Time Digitized             : 2023:04:13 10:42:25+03:00
I know you can write to all three of these tags using:

-EXIF:OffsetTime*=+03:00
blog: http://jmoliver.wordpress.com
flickr:  http://flickr.com/jmoliver

StarGeek

You can copy it directly
C:\>exiftool -time:all --system:all -G1 -a -s y:\!temp\Test4.jpg
[XMP-exif]      DateTimeDigitized              : 2023:04:13 10:42:25+03:00

C:\>exiftool -P -overwrite_original "-OffsetTime*<DateTimeDigitized" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -time:all --system:all -G1 -a -s y:\!temp\Test4.jpg
[ExifIFD]      OffsetTime                      : +03:00
[ExifIFD]      OffsetTimeOriginal              : +03:00
[ExifIFD]      OffsetTimeDigitized            : +03:00
[XMP-exif]      DateTimeDigitized              : 2023:04:13 10:42:25+03:00
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

José Oliver-Didier

blog: http://jmoliver.wordpress.com
flickr:  http://flickr.com/jmoliver

Androne

Is there an easy way to do this in the reverse? So appending the time zone in OffsetTime to an XMP time field that is missing the time zone.

Phil Harvey

Like this?:

exiftool "-xmp:createdate<$xmp:createdate$offsettime" FILE

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

StarGeek

Alternatively, if both EXIF:CreateDate and EXIF:OffsetTimeDigitized exist, then you could use
exiftool "-xmp:createdate<SubSecCreateDate" /path/to/files/

SubSecDateTimeOriginal/SubSecModifyDate would also be possible tags.  Though if any subsecond tags existed, they would also be included.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).