Some on here may know this, some may not. The date of Sept 3, 1752 doesn't exist. You can check this out for yourself at a number of places such as this one.
I was interested in how javascript and the Date() function would handle this, so I tried the following code:
var sept2 = new Date(1752, 8, 2);
var next = new Date(sept2);
next.setDate(sept2.getDate() + 1);
console.log(sept2, next);
I was suprised to see the results:
Date {Sat Sep 02 1752 00:00:00 GMT-0400 (Eastern Standard Time)}
Date {Sun Sep 03 1752 00:00:00 GMT-0400 (Eastern Standard Time)}
There are two errors here:
- the 3rd didn't exist.
- The 2nd should be a Wednesday. It's NOT on a Saturday.
So...are these two issues bugs in Date()?