2012-05-06 8 views
0

私はAssociated PressのRSSフィードを解析しようとしています。日付は本当に混乱しています。ここでは、フィード内の1つの項目の例です。Associated Press RSS date

<entry> 
    <id>urn:publicid:ap.org:Hosted2Syndication:b7f6d88749d341aa9a30e15dcb983b41</id> 
    <title type="text">9/11 defendants ignore judge at Guantanamo hearing</title> 
    <summary type="text">GUANTANAMO BAY NAVAL BASE, Cuba (AP) — They knelt in prayer, ignored the judge and wouldn't listen to Arabic translations as they confronted nearly 3,000 counts of murder. The self-proclaimed mastermind of the Sept. 11 attacks and four co-defendants defiantly disrupted an arraignment that dragged into Saturday night in the opening act of the long-stalled effort to prosecute them in a military court.</summary> 
    <published>2012-05-05T22:38:59-04:00</published> 
    <updated>2012-05-05T20:28:08-04:00</updated> 
    <author /> 
    <link rel="alternate" type="text/html" title="AP Article" href="http://hosted2.ap.org/APDEFAULT/3d281c11a96b4ad082fe88aa0db04305/Article_2012-05-05-Guantanamo-Sept%2011%20Trial/id-b7f6d88749d341aa9a30e15dcb983b41" /> 
    <content type="xhtml"></content> 
</entry> 

ので、公開日は次のとおりです。2012-05-05T22:38:59-04:00

ブラウザでこのアイテムを表示すると、日付のように表示されている:May. 5, 2012 8:28 PM ET

しかし私は、コード内の日付に変換する場合:

DateTime date; 

DateTime.TryParse("2012-05-05T22:38:59-04:00", out date); 

それのように出て来るの:5/5/2012 10:38:59 PM

ウェブサイトの表示日付が2時間違う理由はわかりません。

あなたは、おそらく現在のフィードに任意の項目との違いを見ることができます:

http://hosted2.ap.org/atom/APDEFAULT/3d281c11a96b4ad082fe88aa0db04305

答えて

0

あなたはMay. 5, 2012 8:28 PM ET

として実際の話をロードするときは、正しく記事に <updated>2012-05-05T20:28:08-04:00</updated>日付/時間を見ています
20:28:08 (GMT-4) == 8:28 PM (ET) 

あなたのC#コードは問題ありませんが、実際に公開される2時間前に記事が最後に更新された理由をAPに尋ねる必要があります。

+0

ああ、わかりました。私はの日付を使用しているはずです。とても混乱するような。 –

関連する問題