Lucas Araújo
Lucas Araújo

Reputation: 567

convert string date from pubDate RSS for dd/MM/yyyy hh:mm windows phone 8.1

I am trying to develop a rss reader for windows phone in my file RSSFeed.cs has:

namespace RSSReader
{
[XmlRoot("rss")]
public class RSSFeed
{
    [XmlArray("channel")]
    [XmlArrayItem("item")]
    public List<RSSItem> All { get; set; }
}

public class RSSItem
{
    [XmlElement("title")]
    public string Title { get; set; }

    [XmlElement("description")]
    public string Description { get; set; }

    [XmlElement("link")]
    public string Link { get; set; }

    [XmlElement("pubDate")]
    public string Date { get; set; }
}
}

The pubDate format that is in rss is as follows: Tue, 02 Dec 2014 20:48:00 +0200

but I wanted it to be for example: 02/12/2014 23:57

Upvotes: 0

Views: 189

Answers (1)

Chubosaurus Software
Chubosaurus Software

Reputation: 8161

Take a look at C#'s Custom Date and Time Format Strings : MSDN Link

Parse the string as a DateTime, with DateTime.TryParseExact then

output it to the format you want.

Upvotes: 1

Related Questions