如何减去时间 [英] how to subtract time
本文介绍了如何减去时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个datetimepicker,我想减去并找到时间段。
示例:
datetimepicker1 08:56:18
datetimepicker2 09:12:20
导致格式化
尽快回复我。
谢谢
I have two datetimepicker, i want subtract and find the time period.
Example:
datetimepicker1 08:56:18
datetimepicker2 09:12:20
result in this format
Reply me as soon as possible.
Thank You
推荐答案
尝试:
Try:
Timespan diff = datetimepicker2.Value - datetimepicker1.Value;
查看 Timespan结构 [ ^ ]看看你能对结果做些什么。
平板电脑。永远不要在平板电脑上编码... [/ edit]
Look at theTimespan structure[^] to see what you can do with the result.
[edit] Tablets. Never code on Tablets...[/edit]
可以使用Timespan如下:
Can use Timespan as below:
Timespan diff = datetimepicker2.Subtract(datetimepicker1);
希望有所帮助:)
Hope it helps :)
这篇关于如何减去时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文