Recently, I've been working on passing a time stamp to my API. The timestamp is in the format of YYYY-MM-DD HH:MM:SS
, but I need to adjust the time by adding 5 hours.
I'm not sure if I'm doing this correctly. Should I convert it to a JavaScript date first?
var manDate = "2020-08-16 16:15:00"
manDate.setHours(manDate.getHours() + 5);
data.manDate = manDate
console.log(manDate)
The expected output should be - 2020-08-16 21:15:00