Set "Create Date" to specific Date & Time value?

Started by alicorn2, November 14, 2024, 02:14:16 AM

Previous topic - Next topic

alicorn2

Brand new beginner, overwhelmed by the options of exiftool.  All I want to do is give it a single file and provide a specific date/time the picture was taken.  Windows 11 is stupid and will only let me set the DATE but not the TIME.  Is that possible?

I found how to adjust the time for an entire folder if your camera had the wrong time:
exiftool -AllDates-=1:24:11 MyFolder

But what I want to do is something more like:
exiftool -AllDates="2023-12-27 15:32" 001__.jpg

But when I try that format, it thinks the value in quotes is the file name.  When I try without the quotes it thinks my file name is 15:32. 

Phil Harvey

Your command is correct and works fine for me here when I cut and paste it.  If it thought the date/time was a file name then you probably had a space after the equal sign.  There should be no spaces from the leading dash through to the quotes.

- 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

Quote from: alicorn2 on November 14, 2024, 02:14:16 AMBut what I want to do is something more like:
exiftool -AllDates="2023-12-27 15:32" 001__.jpg

This works correctly for PowerShell and CMD in Windows 10. Now I'm just hoping that Windows 11 hasn't done something to change the command lines.

But as a work around, you don't need to include the space. From FAQ #5
QuoteHaving said this, ExifTool is very flexible about the actual format of input date/time values when writing, and will attempt to reformat any values into the standard format ... Any separators may be used (or in fact, none at all).

This means you can use this
exiftool -AllDates=2023-12-27-15:32 001__.jpg
or even this
exiftool -AllDates=202312271532 001__.jpg

You should know that it is better to use CMD with exiftool, as PowerShell doesn't use standard command line parsing that every other command line uses.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

alicorn2

Quote from: Phil Harvey on November 14, 2024, 07:40:42 AMYour command is correct and works fine for me here when I cut and paste it.  If it thought the date/time was a file name then you probably had a space after the equal sign.  There should be no spaces from the leading dash through to the quotes.

- Phil
Oh my gosh, it absolutely works fine for me today.  You're probably right, I likely put in spaces when I typed it in the cmd window last night as I retyped it here rather than cut & paste.

Sorry for the bother!  I'll go fix the rest of the dates on my files now :)

alicorn2

Quote from: StarGeek on November 14, 2024, 11:08:43 AM
Quote from: alicorn2 on November 14, 2024, 02:14:16 AMBut what I want to do is something more like:
exiftool -AllDates="2023-12-27 15:32" 001__.jpg

This works correctly for PowerShell and CMD in Windows 10. Now I'm just hoping that Windows 11 hasn't done something to change the command lines.

But as a work around, you don't need to include the space. From FAQ #5
QuoteHaving said this, ExifTool is very flexible about the actual format of input date/time values when writing, and will attempt to reformat any values into the standard format ... Any separators may be used (or in fact, none at all).

This means you can use this
exiftool -AllDates=2023-12-27-15:32 001__.jpg
or even this
exiftool -AllDates=202312271532 001__.jpg

You should know that it is better to use CMD with exiftool, as PowerShell doesn't use standard command line parsing that every other command line uses.

Thank you, good to known about the date formats!  I was using cmd yes -- and likely had an extra space as Phil suggested