Kshitij Dhakal
Kshitij Dhakal

Reputation: 844

How to parse pubDate from rss in flutter?

I am trying to parse pubDate from rss into DateTime object.

String parseFormat = "ddd, dd MMM yyyy HH:mm:ss zzz";
this.pubDate = new DateFormat(parseFormat).parse(json['pubDate']);

This throws error

Trying to read ddd from Thu, 14 May 2020 09:40:15 EST at position 0

Upvotes: 1

Views: 373

Answers (1)

Kshitij Dhakal
Kshitij Dhakal

Reputation: 844

Changed to

String parseFormat = "E, dd MMM yyyy HH:mm:ss zzz";
this.pubDate = new DateFormat(parseFormat).parse(json['pubDate']);

from the documentation.

Upvotes: 0

Related Questions