Date the DST problem persisted in a Date Javascript object

I have this simple javascript code

var d = new Date(2011, 9, 8);
alert(d); // Show: Fri Oct 7 23:00:00 UTC-0400 2011

Important: My time zone is Santiago de Chile , and I set my computer clock: October 2, 2011.

A warning shows that Day 7 !! ... why? How can i fix this? (The problem is this day only)

+3
source share
1 answer

According to this page, Changing DST in Chile is always on the second full weekend of October and starts at midnight (allows you to ignore the extended DST this year, as this is most likely your computer does not know about it).

, , script , 8 2011 . ​​ UTC-0300, UTC-0400 .

(, UTC + 1/2h), Sun 27 2011 , 2:00 ( CEST = UTC + 0200) ( (CEST), UTC + 0100 UTC + 0200) (, ))

new Date(2011, 2, 27, 2, 0, 0, 0);

UTC + 0200, UTC + 0100

Sun Mar 27 2011 01:00:00 GMT+0100 (CET)

, Unix time, .

, , 8 - , DST , , , .


: , WinXP DST new Date(2011, 9, 9) ( , - ). , .

, , : , DST, UTC, :

var d = new Date(Date.UTC(2011, 9, 9));
alert(d.toUTCString()); // Shows: Sun, 9 Oct 2011 00:00:00 UTC

/ Date, UTC.

0

All Articles