如何计算两小时之间的移除 [英] How Can I Calculate Removal Between Two Hours

查看:73
本文介绍了如何计算两小时之间的移除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我想从两个MaskedTextBoxs找到工作时间两次





ex。 10:30-14:30 = 4小时

有人可以帮忙吗?

hello i want find worked hours btwen two times from two MaskedTextBoxs


ex. 10:30-14:30 = 4hours
can anyone help?

推荐答案

你可以简单地从14减去10。或者你可以将这两个值转换为适当的时间并使用 TimeSpan Structure(System) [ ^ ]。
Well you could simple subtract 10 from 14. Or you could convert both values to proper times and use the TimeSpan Structure (System)[^].


简单。

您的时间格式为 HM (小时:分钟)。

1)将时间转换为分钟

2)做你的减法

3)转换回HM格式
Simple.
Your Times are in format HM (Hour:Minutes).
1) convert the times to minutes
2) do your substraction
3) convert back to HM format


我能找到任何准备好的代码来扣除两个带有小时数的蒙版盒吗?
can i find any ready code to deduction two maskedboxes with hours?


这篇关于如何计算两小时之间的移除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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