How do I write a timezone offset into the tag <photoshop:datecreated> in a XMP sidecar file using exiftool?
I can write the date and time without problems but cannot achieve by any means to make exiftool write the complete format, which is for example "2026-11-17T12:34:56-01:00:00".
If I add the line
<photoshop:datecreated>2026-11-17T12:34:56-01:00:00</photoshop:datecreated>
manually to the file, I can read out this tag correctly with exiftool.
But how can I force exiftool to add it to the file in this format that includes the timezone information via the command line?
Anyone any ideas that work?</photoshop:datecreated>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Checking List of UTC offsets the only ones that aren't :00 offset are :30 and :45. I thought there was a :15 offset, but I guess I had that mixed up with :45.
None of the listed offsets include seconds.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks so much, StarGeek. Sometimes, one starts missing the forest for the trees. I am well aware of the seconds in the timezones but forgot this for a moment, because usually an error message pops up when exiftool detects a wrong format. In this case, it didn't happen and I got trapped by my own blindness...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note that the dashes and "T" formatting is completely unnecessary, and even possibly misleading. ExifTool expects date/times in EXIF format "YYYY:MM:DD hh:mm:ss-hh:mm" and will reformat properly for XMP. It only tolerates the T's and dashes and any other garbage between the numbers if the -n option is not used.
Last edit: Phil Harvey 2026-11-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do I write a timezone offset into the tag <photoshop:datecreated> in a XMP sidecar file using exiftool?
I can write the date and time without problems but cannot achieve by any means to make exiftool write the complete format, which is for example "2026-11-17T12:34:56-01:00:00".
If I add the line
<photoshop:datecreated>2026-11-17T12:34:56-01:00:00</photoshop:datecreated>
manually to the file, I can read out this tag correctly with exiftool.
But how can I force exiftool to add it to the file in this format that includes the timezone information via the command line?
Anyone any ideas that work?</photoshop:datecreated>
This is probably FAQ #5, How do I format date and time information for writing.
AFAIK, there aren't any time zones that include seconds. The ISO 8601 standard doesn't include an option for seconds.
Drop the seconds from the time zone and your command works correctly.
Last edit: StarGeek 2026-11-17
Checking List of UTC offsets the only ones that aren't
:00offset are:30and:45. I thought there was a:15offset, but I guess I had that mixed up with:45.None of the listed offsets include seconds.
Thanks so much, StarGeek. Sometimes, one starts missing the forest for the trees. I am well aware of the seconds in the timezones but forgot this for a moment, because usually an error message pops up when exiftool detects a wrong format. In this case, it didn't happen and I got trapped by my own blindness...
Note that the dashes and "T" formatting is completely unnecessary, and even possibly misleading. ExifTool expects date/times in EXIF format "YYYY:MM:DD hh:mm:ss-hh:mm" and will reformat properly for XMP. It only tolerates the T's and dashes and any other garbage between the numbers if the -n option is not used.
Last edit: Phil Harvey 2026-11-18