fork download
  1. using System;
  2. using System.Globalization;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var strings = new[]{"06 Mar 2013","26 Mar 2013"};
  9. foreach(string str in strings)
  10. {
  11. DateTime dt = DateTime.ParseExact(str, "dd MMM yyyy", CultureInfo.InvariantCulture);
  12. Console.WriteLine(dt.ToString());
  13. }
  14. }
  15. }
Success #stdin #stdout 0.07s 34024KB
stdin
Standard input is empty
stdout
3/6/2013 12:00:00 AM
3/26/2013 12:00:00 AM