Parse RSS pubDate to Date object in java

后端 未结 3 685
甜味超标
甜味超标 2020-12-04 19:47

How can I parse a pubDate from a RSS feed to a Date object in java.

The format in the RSS feed: Sat, 24 Apr 2010 14:01:00 GMT

What I have at the moment:

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 20:00

    If you need to have an RFC822 compliant date, try this :

    DateFormat dateFormatterRssPubDate = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
    

提交回复
热议问题