RSS发布日期总是“01-Jan-01 12:00:00 am”

本文关键字:01-Jan-01 am 布日期 日期 RSS | 更新日期: 2023-09-27 18:15:43

我尝试从RSS feed 2.0获取pubDate值,但它总是=" 01-01-01 12:00:00 AM"这是RSS订阅

 <item>
<title>title</title> 
<description>desc</description>
<link>http://somelink.com</link>
<pubDate>Thu, 31 Jul 2014 11:13:58</pubDate>
<guid></guid>
<enclosure"/>
</item>

和我的类

public class Item 
    {
        [XmlElement("title")]
        public string Title { get; set; }
        [XmlElement("description")]
        public string Description { get ; set; }
        [XmlElement("pubdate")]
        public DateTime Pubdate { get; set; }
        [XmlElement("link")]
        public string Link { get; set; }
    }

所有项目都工作良好,除了pubDate总是" 01-01-01 12:00:00 AM"。任何帮助吗?

RSS发布日期总是“01-Jan-01 12:00:00 am”

您没有告诉XMLParser属性的格式。试着

[XmlElement("pubdate", DataType = "date")]