int.ToString like HH formatted of DateTime

Posted by nCdy on Stack Overflow See other posts from Stack Overflow or by nCdy
Published on 2010-03-15T07:55:53Z Indexed on 2010/03/15 7:59 UTC
Read the original article Hit count: 626

Filed under:
|
("dd/MM/yyyy HH")+ " - " + (x.Hour+1).ToString();

So here is example

what I got and what I need :

0  --->   00 
3  --->   03 
12 --->   12

How can I use ToString for it ?

I've tried :

x.ToString("dd/MM/yyyy HH") + " - " + x.AddHours(1).ToString("HH");

doesn't works ...

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET