Click here to Skip to main content
15,891,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

Presently i have a problem with live server with this particular error in times span. I am using Framework 4 and i have set configuration in config file also


timespan_legacyformatmode enabled="true"

in 'runtime' tag


and my code is

TimeSpan stopHr = TimeSpan.FromMinutes(stopMin);

r["StopHrs"] = String.Format("{0:HH:mm}", stopHr);



Please help me..
Posted
Updated 22-Oct-14 20:46pm
v2

Try:
C#
r["StopHrs"] = stopHr.ToString("hh\\:mm");
Or
C#
r["StopHrs"] = String.Format("{0:hh\\:mm}", stopHr);
 
Share this answer
 
Comments
George Jonsson 23-Oct-14 3:26am    
Should solve the problem.
+5.
See the solutions at - TimeSpan ToString format[^]
 
Share this answer
 
Check this

http://msdn.microsoft.com/en-us/library/ee803802.aspx
 
Share this answer
 
Comments
Member 10212775 23-Oct-14 3:10am    
i did the configuration changes and i still have the problem.

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

  Print Answers RSS


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