I\'m trying to parse Rss2, Atom feeds using SyndicationFeedFormatter and SyndicationFeed objects. But I\'m getting XmlExceptions while parsing DateTime field like pubDate and/or
to convert PublishDate in RSS to your computer datetime you could write this lines
string dateStr = item.PublishDate.ToString("ffffd MMM dd HH:mm:ss zzzz yyyy");
DateTime PostDate = DateTime.ParseExact(dateStr, "ffffd MMM dd HH:mm:ss zzzz yyyy", CultureInfo.InvariantCulture);
Here is my hacky workaround for reading Google News RSS feeds.
string xml;
using (WebClient webClient = new WebClient())
{
xml = Encoding.UTF8.GetString(webClient.DownloadData(url));
}
xml = xml.Replace("+00:00", "");
byte[] bytes = System.Text.UTF8Encoding.ASCII.GetBytes(xml);
XmlReader reader = XmlReader.Create(new MemoryStream(bytes));
SyndicationFeed feed = SyndicationFeed.Load(reader);