title: Parsing dates with dart
body: <p>I need to parse this kind of date "Mon, 11 Aug 2014 12:53 pm PDT" in a <a href="https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-core.DateTime" rel="noreferrer"><code>DateTime</code></a> object in Dart. </p>
  
  <p>The <code>DateTime</code> has a static method <a href="https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-core.DateTime#id_parse" rel="noreferrer"><code>parse</code></a> that accepts a subset of ISO 8601 format, not my case.</p>
  
  <p>The <a href="https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat" rel="noreferrer"><code>DateFormat</code></a> class lets you define the date pattern to parse. I've created the pattern "EEE, dd MMM yyyy hh:mm a zzz". </p>
  
  <p>Using it I get a <code>FormatException: Trying to read a from Mon, 11 Aug 2014 12:53 pm PDT at position 23</code>. </p>
  
  <p>Looks like the parser does not like the PM marker case (I've open an <a href="https://code.google.com/p/dart/issues/detail?id=20453" rel="noreferrer">issue</a> about). </p>
  
  <p>I've tried to workaround the issue upper casing the entire string. With the string all upper case I get again a FormatException due to the week day and the month names in upper case.</p>
  
  <p>Any other solution or workaround?</p>