title: Why does the ISO-8601 specification appear to be universally ignored when it comes to decimals?
body: <p>From the ISO-8601:2004(E) Specification:</p>
  <blockquote>
  <p><strong>4.2.2.4 Representations with decimal fraction</strong></p>
  <p>If necessary for a particular application a decimal fraction of hour, minute or second
  may be included. If a decimal fraction is included, lower order time
  elements (if any) shall be omitted and the decimal fraction shall be
  divided from the integer part by the decimal sign specified in ISO
  31-0, i.e. the comma [,] or full stop [.]. Of these, the comma is the
  preferred sign.</p>
  </blockquote>
  <p>Simple enough.  So according to this spec, fractions of a second are preferred to be written using a comma separating the whole and decimal parts, such as <code>2014-01-01T00:00:00,123</code>.  However it seems that just about everywhere, only a decimal point (aka &quot;full stop&quot;) is accepted!</p>
  <p>Now I'm sure there are some languages or libraries that took this into account, and I know in many cases you can supply the full details of the format yourself.  But it seems like such a glaring oversight of the specification and it appears that a wide variety of programmers have made the same mistake.  <strong>Is there a reason why this is the case, other than pure human error?</strong></p>
  <p>Below is a list of where I tested.  Feel free to edit the question to augment my list if you find any others.  Thanks.</p>
  <h3>.NET / C#</h3>
  <pre class="lang-csharp prettyprint-override"><code>DateTime dt = DateTime.Parse(&quot;2014-01-01T00:00:00,123&quot;);
  </code></pre>
  <p>Throws a <code>FormatException</code> with the message &quot;String was not recognized as a valid DateTime&quot;.  The same thing with a period instead of a comma parses successfully.</p>
  <h3>JavaScript Date Object</h3>
  <p>Tested in latest (as of this writing) Chrome, Internet Explorer, Firefox and Node.js:</p>
  <pre class="lang-javascript prettyprint-override"><code>var dt = new Date('2014-01-01T00:00:00,123');
  </code></pre>
  <p>Returns <code>&quot;Invalid Date&quot;</code>.  Using a period instead works fine.</p>
  <h3>JavaScript with <a href="http://momentjs.com" rel="noreferrer">moment.js</a></h3>
  <pre class="lang-javascript prettyprint-override"><code>var valid = moment(&quot;2014-01-01T00:00:00,123&quot;).isValid();
  </code></pre>
  <p>Returns <code>false</code>.  Using a period instead returns <code>true</code>.</p>
  <h3>PHP</h3>
  <pre class="lang-php prettyprint-override"><code>echo strtotime('2014-01-01T00:00:00,123');
  </code></pre>
  <p>Returns an empty string.  Using a period instead works fine.</p>
  <h3>Ruby</h3>
  <pre class="lang-ruby prettyprint-override"><code>require 'time'
  puts Time.iso8601(&quot;2014-01-01T00:00:00,123&quot;)
  </code></pre>
  <p>Gives a runtime error.  While <code>Time</code> doesn't keep fractional seconds, it shouldn't error - and indeed if a period is used instead, it works.</p>