fork download
  1. using System;
  2. using System.Globalization;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string messageReceiptDate = "2014-02-03T19:00:00";
  9. String MessageRecieptDate = messageReceiptDate.Replace("T", " ").Remove(messageReceiptDate.Length - 3);
  10. IFormatProvider culture = new CultureInfo("en-US");
  11. DateTime dt = new DateTime();
  12. dt = DateTime.ParseExact(MessageRecieptDate, "yyyy-MM-dd HH:mm", culture);
  13. Console.WriteLine(dt);
  14. }
  15. }
Success #stdin #stdout 0.07s 34016KB
stdin
Standard input is empty
stdout
2/3/2014 7:00:00 PM