
Signature
Michael S. Scherotter
Business Solutions Architect
Mindjet LLC
The basic answer is simple. Index 26 is where 'EDT' starts and
DateTime.Parse is never going to handle an abbreviation for any timezone.
The answer you want to hear is a little more complicated and depends upn
where you are at the time you attempt to parse the value. I am going to
assume that the value is always in the format, i.e., always has a 3
character timezone code at the end.
If you are always in the timezone indicated by the timezone code in the
string then you can disregard it completely. Simply remove the last 3
characters from the value, trim any whitespace from it directly prior to
parsing and treat the result as a local date/time.
If you are NOT always in the timezone indicated by the timezone code then
you need to handle the timezone part yourself. For the EDT timezone you need
to modify the value to read "Thu, 05 May 2005 14:50:52 -4:00". For the EST
timezone you need to modify the value to read "Thu, 05 May 2005
14:50:52 -05:00". Once you have done this you need to parse the value using
DateTime.ParseExact("ddd, dd MMM yyyy HH:mm:ss zzz"). The result will be the
value is respect of the indicated timezone.
> How do I use the .Net 1.1 System.DateTime so that it will parse the string
>
[quoted text clipped - 10 lines]
> Thanks,
> Michael
User - 06 May 2005 03:04 GMT
What about daylight savings time?
> The basic answer is simple. Index 26 is where 'EDT' starts and
> DateTime.Parse is never going to handle an abbreviation for any timezone.
[quoted text clipped - 36 lines]
> > Business Solutions Architect
> > Mindjet LLC
Stephany Young - 06 May 2005 03:49 GMT
My fourth paragraph specifically mentions daylight saving and non-daylight
saving time.
> What about daylight savings time?
>
[quoted text clipped - 43 lines]
>> > Business Solutions Architect
>> > Mindjet LLC