I am having an odd problem using the DateTime.ParseE xact() method that
I'm hoping someone can help me with.
I have XML files that use 2 different date formats internally. I am
trying to use the same call to ParseExact to parse either format. I am
using C# to call the following form of ParseExact:
public static DateTime ParseExact(stri ng, string[], IFormatProvider ,
DateTimeStyles) ;
Examples of the 2 formats I'm passing in the source string are:
20031211T151302 Z
and
2003-12-03T16:32:00-5:00
The format strings I'm passing in the 2nd argument are defined with:
private string[] sDateFormats = new string[] {"yyyyMMdd\\THH mmss\\Z",
"yyyy\\-MM\\-dd\\THH:mm:sszz z"};
The problem is that when I attempt to parse dates in the 2nd format a
FormatException is thrown.
Any help is greatly appreciated
Fred Strauss
Project Manager
Associated Press
212-621-1968
fr**********@ap .org