MM:SS两次之间的差异 [英] Difference between two times in MM:SS
问题描述
大家好
我正在使用数据视图Web部件来呈现通过REST调用检索的数据源.您必须原谅我的天真,因为我不是从事贸易的开发人员,而我对2010年设计师来说还很陌生.
其中一个元素是ISO DateTime值,该值代表上一次状态更改发生的时间.
我正在尝试向表中添加一列,以将该元素与当前时间进行比较,并返回以小时和分钟为单位的持续时间,这就是我要模拟的内容:
名称 |
状态 | 时间 在州内 |
约翰 |
交谈 | 00:03:32 |
史蒂夫 |
交谈 | 00:04:54 |
Kirsty |
不是 准备好 | 00:15:06 |
我有状态更改时间的值:
ddwrt:FormatDate(string(stateChangeTime),2057,12)
和当前时间的值
ddwrt:FormatDate(string(ddwrt:TodayIso()),2057,12)
与SharePoint的其他功能不同,XSLT确实不想让我轻易地减去这两个日期来给我持续时间-谁能帮助菜鸟?
谢谢!
Rob9438576,
首先,您必须在XSLT中将ISO时间转换为标准时间.检查下面的链接进行转换.
http://thesharepointhive.blogspot.ae/2016/01/use-ddwrt-to-format-your-dates.html
https://panvega.wordpress.com/2008/12/08/ddwrtformatdate-with-different-formatflags/
完成后,您将可以使用以下公式之一轻松获得差异:
http://itgroove.net/brainlitter/2008/11/08/how-to-calculate-the-total-time-difference-between-two-date-time-fields-in-a-custom-list /
https://abstractspaces.wordpress.com/2009/05/02/common-date-time-formulas-for-sharepoint-calculated-fields/
此致
Hi all
I'm using the Data View Web Part to render a data source that I'm retrieving via a REST call. You'll have to excuse my naivety as I'm not a developer by trade and I'm pretty new to designer 2010.
One of the elements is an ISO DateTime value that represents the last time a change in state occurred.
I'm trying to add a column to the table that will compare this element to the current time, returning the duration in hours and minutes, this is what I'm trying to Emulate:
Name |
State |
Time in State |
John |
Talking |
00:03:32 |
Steve |
Talking |
00:04:54 |
Kirsty |
Not ready |
00:15:06 |
I have the value of the state change time:
ddwrt:FormatDate(string(stateChangeTime) ,2057 ,12)
and the value of the current time
ddwrt:FormatDate(string(ddwrt:TodayIso()) ,2057 ,12)
Unlike other bits of SharePoint, XSLT really doesn't want to make it easy for me to subtract these two dates to give me the duration - can anyone help a noob out?
Thanks!
Hi Rob9438576,
First you have to convert the ISO time to standard time in XSLT. Check below link to convert.
http://thesharepointhive.blogspot.ae/2016/01/use-ddwrt-to-format-your-dates.html
https://panvega.wordpress.com/2008/12/08/ddwrtformatdate-with-different-formatflags/
Once done you will be able to get the difference easily using one of the formulas:
http://itgroove.net/brainlitter/2008/11/08/how-to-calculate-the-total-time-difference-between-two-date-time-fields-in-a-custom-list/
https://abstractspaces.wordpress.com/2009/05/02/common-date-time-formulas-for-sharepoint-calculated-fields/
Regards,
这篇关于MM:SS两次之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!