I'm working on a NodeJS Projects and I get wrong Date values. And I don't get what I am doing wrong.
var d = new Date(results.timestamp);
console.log(results.timestamp); // 2016-05-10T13:29:47 <- this is right (stored at my DataBase)
A few errors here:
getMonth returns a
0 based month. That is May is
getDay returns the day of the week. I guess you want
the date is parsed as UTC and
getHour is according to the locale. So the hour might be different from what you want (but right here it seems to be "exact", as is it's the same value than inputted).
A tip for your next problems: Have a look at some documentation. For example the MDN.