DateTime d = DateTime.Now; // 12 hour format string aaa = d.ToString("hh:mm"); // 24 hour format string aa =d.ToString("H:mm");
string [] s ={"10AM", "5PM"}; DateTime [] h = {DateTime.Parse(s[0]), DateTime.Parse(s[1])}; if (h[0] > h[1]) Console.WriteLine("{0} is later than {1}", s[0], s[1]); else Console.WriteLine("{0} is earlier than {1}", s[0], s[1]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)