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[1].timestamp);
console.log
A few errors here:
getMonth
returns a 0
based month. That is May is 04
.
getDay
returns the day of the week. I guess you want getDate
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.