ExifTool is a powerful tool for modifying meta data on images. What is the simple command line to specify the date and time for an image?
ExifTool – How to Set an Image’s Date and Time with Timezone
exiftool
exiftool
ExifTool is a powerful tool for modifying meta data on images. What is the simple command line to specify the date and time for an image?
Best Answer
One problem is the fact that the EXIF standard separates the date/time (
EXIF:DateTimeOriginal
) and the time zone (EXIF:OffsetTimeOriginal
) into different tags. The subseconds (EXIF:SubSecTimeOriginal
) are also located in a different tag.Luckily, exiftool gives you a shortcut to write all three locations in a single command. You would use
This will write 2022:12:12 12:00:00 to the
EXIF:DateTimeOriginal
, 24 to theEXIF:SubSecTimeOriginal
, and -08:00EXIF:OffsetTimeOriginal
at the same time.Also of note are the
SubSecCreateDate
andSubSecModifyDate
tags.SubSecCreateDate
writes to theEXIF:CreateDate
(calledDateTimeDigitized
by the EXIF spec),EXIF:SubSecTimeDigitized
, and theEXIF:OffsetTimeDigitized
tags.SubSecModifyDate
writes to theEXIF:ModifyDate
(calledDateTime
by the EXIF spec),EXIF:SubSecTime
, and theEXIF:OffsetTime
tags.There is also the XMP standard, which is much more flexible. It can either be embedded in the file or as an XMP sidecar. The XMP standard allows for all the data in a single tag. The command for writing to an XMP tag would be similar
Additional tags for XMP would be
XMP:CreateDate
andXMP:ModifyDate
One final thing to take note of for the XMP time stamps is that the Exif 2.32 metadata for XMP standard uses
XMP:DateTimeOriginal
as the corresponding tag forEXIF:DateTimeOriginal
, while the IPTC Photo Metadata Standard 2022.1 uses theXMP:DateCreated
as the corresponding tag.