Shift results in negative time

Started by JlrJlr, November 25, 2021, 06:19:43 PM

Previous topic - Next topic

JlrJlr

In my old photo I have set the time part of DateTimeOriginal to 0:0:0 but I need to change it to 01:01:00

This was done with  -EXIF:DateTimeOriginal+=01:01:00

It worked ok for most photos but a dozen produced

Warning: Shift results in negative time when shifting DateTimeOriginal

and the time was kept to 0:0:0

Then I tried to process only the unchanged photos.
If I run exiftool photo per photo it is ok.
If the run is done on a list of photos only the 1st is set to 1:1:0 the others produce the warning

Bellow a test case of 2 photos (in fact 2 copies of the same file)

Time Before

======== IMG_5406_1.jpg
[System]        FileModifyDate                  : 2021:02:08 23:21:37+01:00
[ExifIFD]       DateTimeOriginal                : 1967:05:19 00:00:00
======== IMG_5406_2.jpg
[System]        FileModifyDate                  : 2021:02:08 23:21:37+01:00
[ExifIFD]       DateTimeOriginal                : 1967:05:19 00:00:00


The run

exiftool  -progress -overwrite_original -EXIF:DateTimeOriginal+=01:01:00  -ext jpg    IMG_5406_1.jpg IMG_5406_2.jpg
======== IMG_5406_1.jpg [1/2]
======== IMG_5406_2.jpg [2/2]
Nothing changed in IMG_5406_2.jpg
Warning: Shift results in negative time when shifting DateTimeOriginal - IMG_5406_2.jpg
    1 image files updated
    1 image files unchanged


Time After

======== IMG_5406_1.jpg
[System]        FileModifyDate                  : 2021:11:25 23:35:46+01:00
[ExifIFD]       DateTimeOriginal                : 1967:05:19 01:01:00
======== IMG_5406_2.jpg
[System]        FileModifyDate                  : 2021:02:08 23:21:37+01:00
[ExifIFD]       DateTimeOriginal                : 1967:05:19 00:00:00


I am running Exitool 12.36 on Windows 10 I can provide the photo file if needed

tanks for your answer

Phil Harvey

The time zero for the standard C libraries is 1970:01:01 00:00:00.  Any time before 1970 is negative, and will yield unpredictable results when shifting because it uses the standard C libraries.

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