I have a program that uses the Date object in JavaScript. I’ve noticed that the program is not working properly in all time zones (countries).
So I’ve changed my Windows time zone and I got strange results in specific dates.
With these lines of codes I have same results in many Time Zones but one of them (maybe some):
console.log( new Date( 2005, 2, 20 ) ); // 2005 Mar 20
console.log( new Date( 2006, 2, 20 ) ); // 2006 Mar 20
Time Zone: UTC 00:00 (Correct)

Time Zone: Pacific (US & Canada) -08:00 (Correct)

Time Zone: Newfoundland -03:30 (Correct)

Time Zone: China +08:00 (Correct)

Time Zone: Iran +03:30 (Incorrect!)

(Notice the 19 Mar and 23:00:00 and Daylight vs. Standard)
(I’ve tested the problem in Chrome with the same result)
I’ve solved the problem with this solution:
new Date( Date.UTC(2005, 2, 20) );
But I want to know what happens here?
Is +03:30 has any bugs? What is the difference between Daylight and Standard?
That’s weird…
There is no problem with date object. Some countries observe daylight savings during spring and autumn season to get more daylight time. Check Here. It just so happened that on 20 March 2005 Iran’s time was subject to daylight savings. Showing you correctly what time they were observing (Notice that the difference with GMT changed from +0430 to +0330). Where as on that day in year 2006 they were following the regular time and not subject to daylight savings.
Refer to “Frits van Campen” link in the comments.