views:

57

answers:

1

Hello,

How would I convert an arbitrary System.DateTime to a four character military time string.

  • Example 1: 7am would be "0700"
  • Example 2: 2pm would be "1400"

Thanks!

+7  A: 

Wouldn't

DateTime.Now.ToString("HHmm") 

do what you need?

ZombieSheep
Wow, fast. It won't even let me accept so quick. Will mark as answer shortly. thanks!
Adam Kane