Memorializing this since I spent entirely too much time and bugged @Justin_Barrett @Bill.French and @openside to get this output. I needed to output the US date format into an email, but I needed “tomorrow’s date” to be output. The use case was an email that goes out through automations every Wednesday, but they needed a reminder in the email to follow up by Thursday, (Tomorrow’s Date).
Here’s the outcome. It works, so we don’t try to make it more elegant in these parts
let someDate = new Date();
someDate.setDate(someDate.getDate() + 1);
let dateFormatted = someDate.toLocaleString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit'});
output.set('thisDate', dateFormatted);
You can add whatever number to the second line to add, haven’t tried subtracting. Also, the toLocaleString() without any modifiers outputs a date and time.