Re: PST Timezone in .NET 2.0
"Franklin Tse" <[email protected]> Fri, 7 Dec 2007 11:39:07 +0800
| Newsgroups | gmane.network.syndication.rss.support |
|---|---|
| Message-ID | <BAY128-DS39A746228B42E77EE353E9F680__26992.9948299707$1196998824$gmane$org@phx.gbl> |
The .NET System.DateTime.Parse method and Convert.ToDateTime method seem not
understanding all obs-zone defined in Section 4.3 of RFC 2822 except "GMT"
and "Z".
http://tools.ietf.org/html/rfc2822#section-4.3
Tested with the following code:
class TimeConvert {
private static void Main() {
System.Console.Write("Please enter a time string: ");
string strDateTime=System.Console.ReadLine();
System.DateTime dateTime;
try {
dateTime=System.DateTime.Parse(strDateTime);
}
catch(System.FormatException) {
System.Console.WriteLine("Invalid format.");
return;
}
System.DateTime univDateTime=dateTime.ToUniversalTime();
System.Console.WriteLine(univDateTime+" UTC");
}
}
-Franklin
--------------------------------------------------
From: "James Holderness" <[email protected]>
Date: Friday, 07 December, 2007 10:20
To: <[email protected]>
Subject: Re: [rss-public] PST Timezone in .NET 2.0
> Sam Ruby wrote:
>> I imagine that James might be in a better position than me, as I believe
>> that he has accrued a set of technical legal but in practice very
>> problematic examples of RFC [2]822 formatted dates.
>
> Back when I tested dates, there were a couple of aggregators that didn't
> understand U.S. timezones (not just PST though). RssReader (which I
> believe
> uses .NET) was one of those affected. However, not all .NET aggregators
> were
> affected (RSS Bandit, for example, was fine).
>
> Regards
> James
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/rss-public/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/rss-public/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/