计算infopath 2010中2个日期时间之间的时差 [英] Calculate difference between 2 Date time in infopath 2010

查看:187
本文介绍了计算infopath 2010中2个日期时间之间的时差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个包含三个字段的infopath 2010表单:
2个日期时间和第3个日期时间包含两个小时之间的时差
我如何区分两者,以便显示如下:
日期时间1 2010年5月1日22:00
日期时间2 2010年6月1日1:00
差异场3:00
预先感谢您的回答

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

推荐答案

应该给您一个开始
Should give you a start
TimeSpan ts = date1 - date2;
string s = ts.TotalHours.ToString();


这篇关于计算infopath 2010中2个日期时间之间的时差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆