Chrome's Strange Date Behavior

Why do these almost 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. The browser works in Russian. Converting 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 
+7
javascript datetime
source share
1 answer

This is a chrome issue, you can view the discussion here https://code.google.com/p/v8/issues/detail?id=3116 and at https://code.google.com/p/chromium/issues/detail? id = 417640 search #31 ulan@chromium.org ,

This issue is fixed in version 3.29.39.

+3
source share

All Articles