I am trying to understand more about the Date object in javascript.
I thought that when you call valueOf(), you get the amount of milliseconds since january 1, 1970.
So what I would expect is that the following should return exactly zero;
alert((new Date(1970, 1, 1).valueOf() )/ ( 86400 * 1000));
but it does not, it returns 30.958333333333332. What am I missing?
gr,
Coen
Second parameter, month, starts with 0, so you need to do:
but even with this you’ll get the offset, in seconds, off GMT.
the value you posted says you are
GMT +1: )