title: Convert DateTime to ISO 8601
body: <p>In Dart, how can I convert a <a href="https://api.dartlang.org/apidocs/channels/stable/#dart-core.DateTime" rel="noreferrer">DateTime</a> to its <a href="http://www.iso.org/iso/home/standards/iso8601.htm" rel="noreferrer">ISO 8601</a> representation?</p>
  
  <p>Just doing this</p>
  
  <pre><code>var dt = new DateTime.now();
  print (dt.toString());
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>2014-02-15 08:57:47.812
  </code></pre>
  
  <p>which isn't quite ISO 8601, that would be</p>
  
  <pre><code>2014-02-15T08:57:47.812
  </code></pre>
  
  <p>so only the "T" is missing - I can easily write my own function for this, just wondering if that already exists somewhere in the core libraries?</p>
  
  <p>The other direction, ISO 8601 to DateTime, is already supported by <a href="https://api.dartlang.org/apidocs/channels/stable/#dart-core.DateTime@id_parse" rel="noreferrer">DateTime.parse</a>.</p>
  
  <p><strong>EDIT</strong> looks like the Dart team is adding this now, see <a href="https://code.google.com/p/dart/issues/detail?id=16902" rel="noreferrer">here</a>.</p>