Neir0
Neir0

Reputation: 13367

How can I get HH format for hours in DateTime?

When I invoke ToString method of DateTime I get the follow string

"17.05.2010 8:05:22".

Is there any other DateTime format where i can get the follow string

"17.05.2010 08:05:22" 

with zero before the eight hours?

Upvotes: 1

Views: 609

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038730

someDateInstance.ToString("dd.MM.yyyy HH:mm:ss")

Upvotes: 6

Related Questions