title: ISO 8601 Date JS Interpretation Difference - IE/FF versus Chrome
body: <p>Why do IE/FF and Chrome javascript engines <a href="http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators" rel="nofollow">differ on how to interpret</a> this <strong>Date format</strong> (<em>YYYY-MM-DDTHH:mm:ss.fff</em>) without the timezone designator?</p>
  
  <pre><code>new Date("2015-02-18T15:43:57.803").getUTCHours()
  </code></pre>
  
  <h3>UTC Hours</h3>
  
  <blockquote>
    <p><strong>Chrome:</strong> 15
    <br/>
    <strong>IE11/FF:</strong> 21</p>
  </blockquote>
  
  <p>I don't understand this - is it because Chrome assumes it's local whereas IE/FF assume it's UTC? This seems like a Chrome bug.</p>
  
  <p>Interestingly - appending a "Z" to the end of the string tells both Chrome and IE/FF that the time is UTC and they can agree. Has anyone else noticed this javascript implementation discrepancy with <code>Date</code>?</p>
  
  <pre><code>new Date("2015-02-18T15:43:57.803Z").getUTCHours()
  </code></pre>
  
  <h3>UTC Hours</h3>
  
  <blockquote>
    <p><strong>Chrome:</strong> 15
    <br/>
    <strong>IE11/FF:</strong> 15</p>
  </blockquote>
  
  <p>Ultimately - this is the result of the <a href="http://www.asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization" rel="nofollow">out-of-box serializer for ASP.NET Web API</a>, which I thought used JSON.NET, but now appears to be internal where JSON.NET uses <a href="https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs" rel="nofollow"><code>IsoDateTimeConverter</code></a>. </p>
  
  <p>Checking <code>GlobalConfiguration.Configuration.Formatters.JsonFormatter</code> tells me we're using <a href="https://msdn.microsoft.com/en-us/library/system.net.http.formatting.jsonmediatypeformatter%28v=vs.118%29.aspx" rel="nofollow"><code>JsonMediaTypeFormatter</code></a>. Is Web API not using JSON.NET serializer out of the box? </p>
  
  <p>This is a boon for Web API people - at least back in ASP.NET MVC we had a consistent date format (<em>albeit proprietary - <strong>/Date(number of ticks)/</em></strong>) via the <a href="https://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer%28v=vs.110%29.aspx" rel="nofollow"><code>JavascriptSerializer</code></a></p>