Change timestamp "date created" + 1 second

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Change timestamp "date created" + 1 second

Postby pepalojza » Wed Mar 31, 2021 8:25 pm

Hello, I need some help with my files. I need to change file timestamps of "date created". It's in the form of DD.MM.YY HH:MM:SS and I need for every file to add 1 more second. I have files sorted, that go from 1 to 2000. The date doesn't really matter, but I need the next file to be always + 1 second, or hour... just newer from the previous one. I need to import pictures exactly in order into an app and it only supports automatic sorting by date created. Thank you so much!
Posts: 1
Joined: Wed Mar 31, 2021 8:17 pm

Re: Change timestamp "date created" + 1 second

Postby Luuk » Thu Apr 01, 2021 8:23 am

Its unfortunate, but neither of the manuals does give examples for setting the dates with javascript code.
There must be a way to conduct like your explanation, but Im not finding any examples in the forum either.
If you have the exiftool.exe, this is a command line that probably conducts like you are wanting...

exiftool -FileCreateDate"<${FileCreateDate;s/ .*//}0:0:0}" -execute -FileCreateDate+"<0:0:$FileSequence" -common_args -fast4 -ext jpg -overwrite_original .

For jpg files, its making the FileCreateDates like this...
file1.jpg "Date1 00:00:00"
file2.jpg "Date1 00:00:01"
file3.jpg "Date1 00:00:02"
File4.jpg "Date2 00:00:03" (so not resetting for Date2)

Its easier to just give everybody one date, but Im guessing that you need to keep the dates locked?
So it never changes any of the dates, unless there can be times going all the way past 23:59:59, lol.
First it just changes all the times to 00:00:00, and then it starts incrementing like in your explanation.
If you need, I also have a batch that resets to 00 for each new date, but wish I can do all this in the javascript.

For javascript, all I know is there is object("created") for FileCreateDate, and a variable "counter" to conduct increments.
Im hoping the next manual to have more examples for writing the new dates inside the javascript.
If you can find a javascript solution, please to make the post here so everyone can learn.
Posts: 323
Joined: Fri Feb 21, 2020 10:58 pm

Re: Change timestamp "date created" + 1 second

Postby therube » Thu Apr 01, 2021 3:59 pm

Another alternative, (Nirsoft's) BulkFileChanger.
Posts: 1025
Joined: Mon Jan 18, 2016 6:23 pm

Return to Javascript Renaming