fork(101) download
  1. using System;
  2. using System.Globalization;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string one = "13/02/09";
  9. string two = "2:35:10 PM";
  10.  
  11. DateTime dt = Convert.ToDateTime(one + " " + two);
  12. DateTime dt1 = DateTime.ParseExact(one + " " + two, "dd/MM/yy h:mm:ss tt", CultureInfo.InvariantCulture);
  13.  
  14. Console.WriteLine(dt1);
  15. }
  16. }
Success #stdin #stdout 0.07s 34200KB
stdin
Standard input is empty
stdout
2/13/2009 2:35:10 PM