I'm running Node Red v3.0.2 in a Linux VM
I'm trying to write some code to determine tomorrow's day of the month. One of my goals is to be as lean as possible, as this will run in a small system later. So to avoid adding large contributions, my approach is to get today's time, add 18400000 milliseconds to it (to get same time tomorrow), then get the date for that time. Here's my code:
var today = new Date().getTime();
var nDate = new Date().getDate();
var tomorrow = today + 18400000;
var tDate = new Date(tomorrow).getDate();
node.warn("Today = " + today + ", date = " + nDate);
node.warn("Tomorrow = " + tomorrow + ", date = " + tDate);
This worked a few times, but now I'm getting that today and tomorrow are the same:
Today = 1672050837310, date = 26
Tomorrow = 1672069237310, date = 26
The timestamp difference seems OK, but the date returned is not.
Any hints on what I'm doing wrong?