I need help with converting standard time to military time through a button.
Then being able to use another button to convert back.
Jump to Post
Where are you getting the time you want to convert? Where do you want the result to end up?
If you have it in a DateTime object, then:
myDTobject.ToString("hh:mm"); // 'standard' time myDTobject.ToString("HH:mm"); // 'military' (or 24 hour) time
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.