help about changing date of thousand of files, again.

Advanced Renamer forum
#1 : 12/11-23 15:05
Tucoco
Tucoco
Posts: 5
Hi, im back from thread called "help about changing day and hour of thousand of files" https://www.advancedrenamer.com/forum_thread?for um_id=13251
I post here because i cant reply anymore on that old thread.

That is the original script you posted:

deltaHour = 3;
match = item.name.match(/^(\d{4})-(\d{2})-(\d{2}) (\d{2})\.(\d{2})\.(\d{2})(.*)/);
if (match) {
Y = 1*match[1];
M = 1*match[2] - 1;
D = 1*match[3];
h = 1*match[4];
m = 1*match[5];
s = 1*match[6];
h += deltaHour;
date = new Date(Y, M, D, h, m, s);
Y = date.getFullYear();
M = date.getMonth() + 1;
D = date.getDate();
h = date.getHours();
m = date.getMinutes();
s = date.getSeconds();
return Y + "-" + ("0" + M).slice(-2)+ "-" + ("0" + D).slice(-2)
+ " " + ("0" + h).slice(-2) + "." + ("0" + m).slice(-2) + "." + ("0" + s).slice(-2)
+ match[7];
}


I need the script changed to affect the filename in a specific way now, instead of adding 3 hours i need it to substract a second.

2023-01-01 00.00.00 xxxxxxxxxxxxx.jpg -> 2022-12-31 23.59.59 xxxxxxxxxxxxx.jpg


12/11-23 15:05
#2 : 12/11-23 15:09
Tucoco
Tucoco
Posts: 5
Reply to #1:

Im sorry, edit seems to be not working correctly and repost the entire thread again in front page.


12/11-23 15:09