Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to assign time like 14:12:21
when i add time it takes after 12 ->1..
guide me..
Posted
Comments
CodingLover 16-Nov-11 5:16am    
It's all about the formatting. deepakdynamite1 post a nice article for you reference.

Check this out .. ITs in there


http://blog.stevex.net/string-formatting-in-csharp/[^]


Use HH:MM
 
Share this answer
 
Comments
kalaiking 16-Nov-11 5:49am    
my problem is if i add 13:10:11
the result is set 1:10:11..
DateTime.Now.ToString("HH:mm:ss");


For anyother format you need, Check on the below link
http://www.csharp-examples.net/string-format-datetime/[^]
 
Share this answer
 
v2
check your time zone in your system,set changes to (GMT+TIME)
 
Share this answer
 
Comments
kalaiking 16-Nov-11 7:28am    
i wnt coding..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900