Dec 20, 2002 #1 R rosshodges Freshman Joined Nov 23, 2002 Messages 28 I have time code in my program but its all in 12 hour format. How can I change it into 24 hour time? Regards, Ross
I have time code in my program but its all in 12 hour format. How can I change it into 24 hour time? Regards, Ross
Dec 20, 2002 #2 N Nerseus Danner Joined Oct 22, 2002 Messages 2,547 Location Arizona, USA Try using the ToString() method with HH for hours (make sure it's capitalized). For example (sorry this is in C#, but you can convert I'm sure ): Code: DateTime t = DateTime.Parse("12/20/2002 2pm"); Debug.WriteLine(t.ToString("HH:mm:ss")); // Shows 14:00:00 -ner
Try using the ToString() method with HH for hours (make sure it's capitalized). For example (sorry this is in C#, but you can convert I'm sure ): Code: DateTime t = DateTime.Parse("12/20/2002 2pm"); Debug.WriteLine(t.ToString("HH:mm:ss")); // Shows 14:00:00 -ner
Dec 20, 2002 #3 R rosshodges Freshman Joined Nov 23, 2002 Messages 28 Figured It It has to be HH instead of hh. Thanks for your help Ross