I was just wondering why the following code results in the value of 7 (august) on my node.js box, but not on my browser.
new Date(1378008000 * 1000).getMonth()
Is it not assuming Unix Epoch GMT timezone? What timezone would it be assuming and how should I be handling things like this?
Thanks.
getMonth
returns the month in the local time zone, so it indeed depends on the settings in use.
If you want to have the month base on UTC time, use getUTCMonth
and the rest of the getUTC* family.