Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi.... i want to display only time in a textbox in format HH:MM:SS. when i used datetime.now.tostring() it displayed both date and time.


pls do help me
thank u in advance
Posted
Comments
Sergey Alexandrovich Kryukov 24-Jan-13 23:54pm    
What, reading some documentation is the sacred art?
—SA

datetime.now.tostring("HH:MM");
 
Share this answer
 
Instead of datetime.now.tostring() using this method DateTime.Now.ToShortTimeString()


C#
textbox.Text=DateTime.Now.ToShortTimeString().Tostring();



Enjoy...
 
Share this answer
 
v2
HI,

Check this useful link for the date and time this will really good and will resolve your problem.

Thanks
 
Share this answer
 

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