title: IE 10+ unable to parse the date strings produced with its own Date.prototype.toLocaleString
body: <p>I'm testing an AngularJS application using Selenium. At some point during the test I want to make sure that a date is within an acceptable range. When the test runs, something equivalent to this happens:</p>
  
  <pre><code>Date.parse(new Date().toLocaleString())
  </code></pre>
  
  <p>I say "equivalent" because I'm not explicitly calling <code>toLocaleString()</code> myself but I am parsing the result of <code>toLocaleString()</code> indirectly. When I test on Firefox and Chrome, there is no problem whatsoever. The two browsers are able to parse their own date strings.</p>
  
  <p>On IE, however, I always get <code>NaN</code>. I found if I look at the <a href="http://msdn.microsoft.com/en-us/library/ie/ff743760%28v=vs.94%29.aspx#OtherDateFormats" rel="nofollow">MSDN documentation</a> and use a string literal in the same format as what <code>toLocaleString()</code> produces, there's no error. For instance, this works:</p>
  
  <pre><code>Date.parse("6/9/2010 3:20 pm")
  </code></pre>
  
  <p>I don't understand why when I type in a literal, it works but when I try to use <code>parse()</code> on the result of <code>toLocaleString()</code> it fails.</p>
  
  <p>I got that error in IE 10 and IE 11 but not in IE 9.</p>
  
  <p>I'm well aware of the issues regarding using <code>toLocaleString()</code>, how it can vary depending on user preferences, etc. <em>In the context of my tests</em>, using <code>toLocaleString()</code> is quite correct.</p>