Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have an infopath 2010 form that contains three fields:
2 date time and the 3rd contains the difference between the two in hours
how I can make the difference between the two so that the display will be like this:
Date Time1 05/01/2010 22:00
Date Time2 6/1/2010 1:00
Diff Field 3:00
thank you in advance for your answer
Posted

1 solution

Should give you a start
TimeSpan ts = date1 - date2;
string s = ts.TotalHours.ToString();
 
Share this answer
 
Comments
Jurgita Motiekaitienė 12-Oct-12 7:45am    
which place this code input

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