I\'m using .NET 3.5 and I have a date that comes in as string in the following format:
Tue Jan 20 20:47:43 GMT 2009
First questi
You can use the DateTime.TryParseExact() method with a suitable format string. See here
EDIT: Try something like this:
DateTime dt;
System.Globalization.CultureInfo enUS = new System.Globalization.CultureInfo("en-US");
if ( DateTime.TryParseExact( "Tue Jan 20 20:47:43 GMT 2009", "ffffd MMM dd H:mm:ss \"GMT\" yyyy", enUS, System.Globalization.DateTimeStyles.NoCurrentDateDefault , out dt ))
{
Console.WriteLine(dt.ToString() );
}