Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi i have 2 datetime variable : enterTime & outerTime

and show Time Duration with this code :
C#
timespan dif = outerTime - enterTime ;
textBox1.Text = dif.Duration().toString();


The format of dif.Duration is shown : 00:00:00.0000
but i want shown by this format : 00:00:00
Posted
Comments
[no name] 27-May-13 18:22pm    
http://msdn.microsoft.com/en-us/library/ee372286.aspx
Meisam Parsa 27-May-13 18:38pm    
tnx

1 solution

C#
textBox1.Text = dif.Duration().toString(@"\hh\:mm\:ss");
 
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