Rename with 2 Digit Year (%y) corrupted for pre 1900 dates

Started by sgraystar, July 23, 2020, 06:51:20 PM

Previous topic - Next topic

sgraystar

Definitely a low priority, reporting in case it is a symptom of something else.

When scanning/filing old images I have files named by date eg. 18411201-110001.jpg
And the timestamps have been set with -alldates<filename

Then moving them with a command that includes a two digit year similar to
-d $HOME\Pictures\%Y\%y%m\%Y%m%d-%H%M%S%%-c.%%le

For dates prior to 1900 the year is corrupted for the folder named %y%m, it results in non-digit characters for the year.
if I change to code to a four digit year %Y%m it works OK.

Windows 10 Powershell
ExifTool ver 12.01


Phil Harvey

The underlying standard date/time library functions only work reliably for dates between 1970 and 2034.  There are various problems associated with this, but replacing these functions would be difficult.

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