I need to parse such a date "Mon, 11 Aug 2014 12:53 pm PDT" into a DateTime object in a Dart,
DateTime has a static parse method that accepts a subset of the ISO 8601 format, not my case.
The DateFormat class allows DateFormat to define a date pattern for parsing. I created the template "EEE, dd MMM yyyy hh: mm a zzz".
Using it, I get a FormatException: Trying to read a from Mon, 11 Aug 2014 12:53 pm PDT at position 23 .
It seems like the parser doesn't like the case of the PM marker (I opened issue ).
I tried to get around the problem with the top case of the entire line. With the entire uppercase string, I get a FormatException again due to the day of the week and the month names in uppercase.
Any other solution or workaround?
Fedy2 source share