4 ms·
There's much more simpler (and relevant) ways to break date logic than going back to 1927. Take for instance: var d = new Date(2013, 9, 20); For 200 million
by apaprocki 13y ago
There's much more simpler (and relevant) ways to break date logic than going back to 1927. Take for instance:
var d = new Date(2013, 9, 20);
For 200 million people in the world, d.getDate() will be 19.
Now, are you sure your app doesn't break when that happens?
- bigfoot13442 13y agoI get 20. Care to elaborate?
- apaprocki 13y agoThat date happens to be the date of DST transition in Brazil and Brazil is one of about 10 or so countries that transition at midnight rather than some later time such as 2am. Because of that, and due to how ES5's timezone logic works, the time winds up resetting backwards an hour, putting the Date object in the day before. The other countries that do this are Chile, Paraguay, Cuba, Greenland, Iran, Lebanon, Syria, West Bank, and Gaza Strip. (I think I got them all..)