I'm trying to take the utc time and subtract 5 hours to make it est time in a jpeg.
i'm using this line
exiftool -overwrite_original "-DateTimeOriginal=2022:06:14 03:41:18" -EXIF:OffsetTime*=-05:00 "C:/Users/Eric/Downloads/yeehaw/2022-06-14 03-41-18 UTC.jpg"
and it seems to make a change when i inspect using exiftool
C:\Users\Eric>exiftool "C:\Users\Eric\Downloads\yeehaw\2022-06-14 03-41-18 UTC.jpg"
ExifTool Version Number : 12.55
File Name : 2022-06-14 03-41-18 UTC.jpg
Directory : C:/Users/Eric/Downloads/yeehaw
File Size : 662 kB
File Modification Date/Time : 2023:03:20 19:21:17-04:00
File Access Date/Time : 2023:03:20 19:21:29-04:00
File Creation Date/Time : 2023:03:20 00:24:38-04:00
File Permissions : -rw-rw-rw-
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Exif Byte Order : Big-endian (Motorola, MM)
X Resolution : 1
Y Resolution : 1
Resolution Unit : None
Y Cb Cr Positioning : Centered
Exif Version : 0232
Date/Time Original : 2022:06:14 03:41:18
Offset Time : -05:00
Offset Time Original : -05:00
Offset Time Digitized : -05:00
Components Configuration : Y, Cb, Cr, -
Flashpix Version : 0100
Color Space : Uncalibrated
Image Width : 1947
Image Height : 3840
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 1947x3840
Megapixels : 7.5
Date/Time Original : 2022:06:14 03:41:18-05:00
but it is not reflected in windows properties (look at attachment)
offset_not_working.png[/attach]]offset_not_working.png (http://[attach%20id=4925)
what am i doing wrong?
See this post by StarGeek (https://exiftool.org/forum/index.php?msg=32875) for help figuring out what ExifTool tags are displayed in the Windows properties.
- Phil
Windows doesn't read the the OffsetTime* tags but I suspect you are making an incorrect assumption about the date/time tags.
Unlike videos, the timestamps in images is supposed to be set to local time. The OffsetTime* is not a value to be added/subtracted from the date/time tag. It is simply the local time zone. If it is noon in Pacific time, then the full time stamp is 2023:03:21 12:00:00-07:00. No adjustment is to be made to the values. A photo taken at the same moment in Eastern time would be 2023:03:21 15:00:00-05:00 and the same moment UTC would be 2023:03:21 19:00:00+00:00.
Ok so i was right in thinking that you have to put the local time into the jpeg unlike mp4 but i was wrong in thinking you could change it with OffsetTime. Is there a way for me to modify the datetime original date and time to subtract 5 hours when putting it into the tag in exiftool?
i believe this is what it would be manual -5 hours.
exiftool -overwrite_original "-DateTimeOriginal=2022:06:13 23:41:18" -EXIF:OffsetTime*=-05:00 "C:/Users/Eric/Downloads/yeehaw/2022-06-14 03-41-18 UTC.jpg"
the OffsetTimewould should that its est but not do anything to the time and the time would be utc-5 which is est and be displayed correctly (the local time of the pic).
Ah, so the filename is set to UTC.
I think the easiest would be in two steps. First, you can write the UTC time directly from the filename (see FAQ #5 (https://exiftool.org/faq.html#Q5)). Optionally, you could included the offset time as well as setting the GPS time. As long as all the files are named with UTC time, you could do in batch, just pass exiftool the directory
exiftool "-AllDates<Filename" -OffsetTime*=-05:00 "-Gps*stamp<Filename" /path/to/files/
Then subtract the 5 hours from that date
exiftool -AllDates-=5 /path/to/files/
Example:
C:\>exiftool -P -overwrite_original "-AllDates<Filename" -OffsetTime*=-05:00 "-Gps*stamp<Filename" "Y:\!temp\New folder\2022-06-14 03-41-18 UTC.jpg"
1 image files updated
C:\>exiftool -P -overwrite_original -alldates-=5 "Y:\!temp\New folder\2022-06-14 03-41-18 UTC.jpg"
1 image files updated
C:\>exiftool -time:all --system:all -G1 -a -s "Y:\!temp\New folder\2022-06-14 03-41-18 UTC.jpg"
[IFD0] ModifyDate : 2022:06:13 22:41:18
[ExifIFD] DateTimeOriginal : 2022:06:13 22:41:18
[ExifIFD] CreateDate : 2022:06:13 22:41:18
[ExifIFD] OffsetTime : -05:00
[ExifIFD] OffsetTimeOriginal : -05:00
[ExifIFD] OffsetTimeDigitized : -05:00
[GPS] GPSTimeStamp : 03:41:18
[GPS] GPSDateStamp : 2022:06:14
[Composite] SubSecCreateDate : 2022:06:13 22:41:18-05:00
[Composite] SubSecDateTimeOriginal : 2022:06:13 22:41:18-05:00
[Composite] SubSecModifyDate : 2022:06:13 22:41:18-05:00
[Composite] GPSDateTime : 2022:06:14 03:41:18Z
Ok before i saw your response i ended up doing this and this seemed to work for me
this command is the utc code with the timezone set to utc-4 but not change the original
exiftool -overwrite_original "-DateTimeOriginal=2022:06:13 23:41:18" -EXIF:OffsetTime*=-04:00 "C:/Users/Eric/Downloads/yeehaw/2022-06-14 03-41-18 UTC.jpg"
and then this will change the original datetimeoriginal -4 to put it to utc-4 and it displays correctly
exiftool -overwrite_original "-DateTimeOriginal-=4" "C:/Users/Eric/Downloads/yeehaw/2022-06-14 03-41-18 UTC.jpg"
so apparently where i live it's actually utc-4 and not -5. thats awesome that you can use the filename to set the datetimeoriginal.