Why these nearly similar date objects give different results in Chrome 37?
var d2014 = new Date(2014, 0, 1);
alert(d2014.getFullYear()); // 2013
var d2015 = new Date(2015, 0, 1);
alert(d2015.getFullYear()); // 2015
In IE11 I get "2014" and "2015" as expected. Browser works in Russian locale. Conversion to strings gives the following results:
d2014.toString(); // Tue Dec 31 2013 23:00:00 GMT+0300 (RTZ 2 (зима))
d2015.toString(); // Thu Jan 01 2015 00:00:00 GMT+0300 (RTZ 2 (зима))
d2014.toUTCString(); // Tue, 31 Dec 2013 20:00:00 GMT
d2015.toUTCString(); // Wed, 31 Dec 2014 21:00:00 GMT
This is a chrome specific issue, you can view the discussion here https://code.google.com/p/v8/issues/detail?id=3116 and in https://code.google.com/p/chromium/issues/detail?id=417640 look for
#31 [email protected]
,
This issue is fixed in version 3.29.39
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With