Can you please take a look at this code and let me know how I can get the output in YYYY-MM-DD-HH-MM-SS
format?
As you can see what I am getting now is 2022-04-22
which is YYYY-MM-DD
const d = new Date();
var dStr = new Date(d.getTime() - (d.getTimezoneOffset() * 60000)).toISOString().split("T")[0];
console.log(dStr);