Is this a Daylight Saving Time Bug?
// Pad with zeros
// Test DST.
var newdate = new Date(2006,03,02,02,30);
var strdate = newdate.getFullYear() + "/" + PZ(newdate.getMonth()+1) + "/" + PZ(newdate.getDate()) + " " + PZ(newdate.getHours()) + ":" + PZ(newdate.getMinutes());
Last edited by geolev; 12-08-2006 at 12:47 PM.
OK, I'll try to explain this.
Second, it is not a bug. Right now we are on standard time and the issue you describe only exists for that 1 hour period on the spring change for previous years. The fall time change and future spring changes do not react the same.
Now the difficult part of explaining why it is correct. At 2AM (daylight time) the time jumped to 3AM (standard time). So, looking back from today - using standard time - 3AM was 3AM. But, what was it 1 minute prior to that (2:59AM)? There was no 2:59AM because we skipped over it - so we skip over it, going in reverse this time, and get 1:59AM.
Okay. I'm reading alot into what you said so let me see if I understand.
Do I have it right?
And if you set the date to the 31st of November (new Date(2006,10,31))
you get Dec 1...would you say it is a bug that a nonexistent day or time is
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)