项目问题。 [英] problem with project.
本文介绍了项目问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个日期和调整,我想计算这两个日期和时间的总小时数。请帮助我举例:
2014-08-14 16:10:03和2014-08 -14 16:24:28
i have two date and timming and i want to calculate total hours from this two date and timings.please help me example:
2014-08-14 16:10:03 and 2014-08-14 16:24:28
推荐答案
使用TimeSpan
use TimeSpan
Dim convertedDate1 As Date = Date.Parse("2014-08-14 16:10:03 ")
Dim convertedDate2 As Date = Date.Parse("2014-08-14 16:24:28")
Dim timePeriod As TimeSpan
timePeriod = convertedDate2.TimeOfDay - convertedDate1.TimeOfDay
查看在dotnetfiddle中创建的示例
https://dotnetfiddle.net/iUc8qx [ ^ ]
这篇关于项目问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文