Time Formats

rosshodges

Active member
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
 
Try using the ToString() method with HH for hours (make sure its capitalized).

For example (sorry this is in C#, but you can convert Im sure :)):
Code:
DateTime t = DateTime.Parse("12/20/2002 2pm");
Debug.WriteLine(t.ToString("HH:mm:ss")); // Shows 14:00:00

-ner
 
Back
Top