1913 is a perfectly good guess when given only a two-digit date. The browser has no way of knowing what kind of date your site is asking. For example, if you're asking for the user's DOB, 1913 would be a better guess, as someone born in 2013 wouldn't be old enough to use the site yet.
I can see why you might expect it to guess 2013, but given just two digits, there's no way it can reasonably be expected to get it right every time. It's going to be wrong for someone.
The actual reason for this behaviour is likely to be for backward compatibility.
Older browser versions would have guessed 19xx
when given a two digit date. It would have been a perfectly legitimate guess back in the day.
In the meanwhile, sites would have been written by authors who knew this and may have done tricks like adding 100 to the value to work around the issue.
This means that if a new version of the browser is released that changes this behaviour, it would break those old sites.
Microsoft in particular tends to be very conservative about changing existing behaviour, because of this kind of thing. Therefore they would have left it working the way it always did.
The real solution here is to not use two-digit dates. Just specify four digits in the first place, and there won't be any problems.
However, that's not the complete picture, because part of the problem is down to the lack of cross-browser consistency with the Date
class. You may find that giving two browsers the same date string gives you different values.
For this reason, I recommend not using the built-in Javascript Date
class at all, but instead using one of the libraries that exists to help with this.
The two libraries I can recommend are Date.js and Moment.js.
Both of these libraries will allow you to specify a date, and also specify the format that you're using. They will also both work consistently across all browsers, and will also be more likely to give you the right answer when you specify only two digits for the year (although you're still going to have ambiguity there and possible errors, so I still recommend using four digits).
Hope that helps.