Try to parse string("Thu May 01, 2014") to DateTimeOffset in CSharp
Description
The following code shows how to try to parse string("Thu May 01, 2014") to DateTimeOffset.
Example
/*from w w w .j a v a 2 s . c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset parsedDate;
string dateString;
// String with day abbreviation
dateString = "Thu May 01, 2014";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
Console.WriteLine("{0} was converted to to {1}.",
dateString, parsedDate);
}
}
The code above generates the following result.