G
geolev
I'm trying to understand the effects of the Daylight Saving Time rule
changes for 2007 in the US. Can anyone tell me how Javascript knows
when to apply Daylight Saving Time in the following script?
d1 = new Date(2006, 03, 01, 23, 00);
d2 = new Date(2006, 03, 02, 04, 00);
// Reports "This is ok: The answere should be 4. It is 4".
alert("This is ok: The answer should be 4. It is " + (((d2.valueOf()
- d1.valueOf())/1000)/60)/60);
Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?
Thanks,
George
changes for 2007 in the US. Can anyone tell me how Javascript knows
when to apply Daylight Saving Time in the following script?
d1 = new Date(2006, 03, 01, 23, 00);
d2 = new Date(2006, 03, 02, 04, 00);
// Reports "This is ok: The answere should be 4. It is 4".
alert("This is ok: The answer should be 4. It is " + (((d2.valueOf()
- d1.valueOf())/1000)/60)/60);
Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?
Thanks,
George