Date Handling Problem on dates in the region of c.1904 c1925

Started by Paul Barrett, September 27, 2016, 02:15:53 PM

Previous topic - Next topic

Paul Barrett

Win 10 Home on 64 bit Intel system
Exiftool version 10.11

Expectation: Change File Modified date to match Date/Time Original. 

Problem: Dates in the range 1904 - 1925 are incorrectly updated to 2014 -2025  Later dates are OK and I have done many of them from 1930 through to 1970.  I don't have images for all years so don't know where the tipping is exactly.

Command line:
exiftool "-FileModifyDate<DateTimeOriginal" "-modifydate<DateTimeOriginal" "\\nas02\photo\pictures\1920"

This command was supplied by someone else but was successful on several test subjects from later years.

Sample Result:

Source Data:
---- EXIF ----
Date/Time Original               1920:06:30 00:00:01

Target
---- File ----
File Name                        Great Uncle Harry 1.jpg
Directory                        //nas02/photo/Pictures/1920
File Size                        390 kB
File Modification Date/Time      2020:06:30 00:00:01+01:00

I hope I have provided you with enough information.

Kind Regards

Paul Barrett (newbie)


Phil Harvey

Hi Paul,

ExifTool uses the standard C library functions for date/time which are typically limited to the range 1970 to 2034.

Also, you are trying to set a filesystem date/time, and some filesystems have similar limitations.  So even if ExifTool did its own date calculations, you may still be out of luck depending on what filesystem you are using.

- 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

This actually isn't an error with exiftool, it's has to do with the underlying OS.  You're trying to set the file modify date to a time when there wasn't even computers.  Basically, you can't set any of the FILE timestamps to dates before 1970, because most (all?) computer time is based upon Unix time, which starts January 1st, 1970.  If you try to set the timestamp to a time before that, you have an integer underflow, basically trying to set it to a negative number and since timestamps are unsigned, you end up with a future date.

Here's a video that can help explain it:
Why 1/1/1970 Bricks Your iPhone

* 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).

Paul Barrett

#3
Thank you guys, especially for the rapid response, and I get what you are saying.  To sort out the problem is there a way I can assign a specific date from a text string so I can at least get us back from the future?  ;D

I am a complete newbie on exif tool though it looks fabulous

- Paul

PS From what you said about 2034 being the date limit, I guess that explains these error messages with their 2040 date :)

Warning: Cannot handle date (01, 00, 00, 30, 5, 2040) in File:FileModifyDate (ValueConvInv) - //nas02/photo/pictures/1940/Great Uncle Harry 2.jpg
Warning: Cannot handle date (01, 00, 00, 30, 5, 2040) in File:FileModifyDate (ValueConvInv) - //nas02/photo/pictures/1940/Grandma Beatrice Barrett.jpg

Phil Harvey

You can write a specific date like this:

exiftool -filemodifydate="2016:09:27 17:55:00" 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 ($).

Paul Barrett

>You can write a specific date like this:

>exiftool -filemodifydate="2016:09:27 17:55:00" FILE

>- Phil

Hi Phil

Great - can I substitute FILE with DIR to run it over all images in a folder?

- Paul

StarGeek

* 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).

Paul Barrett

Excellent

And if it's possible, how do I make the DIR string apply to a folder and all its subfolders please?

Regards

Paul

PS This a great forum - so responsive

Hayo Baan

Hayo Baan – Photography
Web: www.hayobaan.nl

Paul Barrett


Paul Barrett

Next question.  Is there a way to tell exif tool not to update the file modified date when executing other metadata actions please?

- Paul

Phil Harvey

Hi Paul,

This is the -P option.  The application documentation explains all this and more...

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

Paul Barrett

Thanks Phil

Don't know why I hadn't found that doc in my searching. Must've had a senior moment  :-[

- Paul

Phil Harvey

Hi Paul,

You can also see the same documentation by running exiftool with no arguments.  The link I gave you above is just an HTML translation of this built-in documentation.

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

Paul Barrett

Thank you

Pointing me at the manual is a bit of a double-edged sword because it just encourages me to do other things and then screw up some more!  ;D

For example, as expected after all the updates I have been doing, I now have a large number of JPG_ORIGINAL files, which I wanted to tidy up.

I started small, on just one file and tried this:

exiftool -delete_original \\nas02\photo\pictures\2000-04\2000-04-01_0001.jpg

As I had not used the ! parameter I expected to get a prompt before deletion.  Instead the command returned this:

    1 image files found
    0 original files found

But I can see the file in Explorer.  I tried running the command on the parent folder with the -r switch in case I had specified the file name incorrectly.  I got exactly the same answer, despite the fact that there are 4 sub folders and 271 files.

It's probably rookie error as usual.  I have stared at this till my eyes have gone square but I cannot see where I have screwed up.

Help please!

- Paul