fork download
  1. using System;
  2. using System.Globalization;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. // your code goes here
  9. string[] a = new string[] {
  10. "14.12.2016 6:20:21",
  11. "15.12.2016 8:30:00",
  12. "16.12.2016 12:30:00",
  13. "17.12.2016 14:33:00",
  14. "18.12.2016 18:10:00",
  15. };
  16. foreach(string dt in a)
  17. {
  18. Console.WriteLine(
  19. DateTime.ParseExact(dt, "dd.MM.yyyy H:mm:ss", CultureInfo.InvariantCulture)
  20. );
  21. }
  22. }
  23. }
Success #stdin #stdout 0.01s 29944KB
stdin
Standard input is empty
stdout
12/14/2016 6:20:21 AM
12/15/2016 8:30:00 AM
12/16/2016 12:30:00 PM
12/17/2016 2:33:00 PM
12/18/2016 6:10:00 PM