如何计算两个时间点之间 [英] how to calculate between two points in time

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

问题描述

我试图在VB中创建一个员工工时表作为第一个项目,但是需要帮助来计算开始时间和结束时间之间的中间午餐时间.我正在使用Visual Basic 2008

I am trying to create an employee timecard as a first project in VB but need help calculating between start and end time with a lunch break in the middle. I am using Visual Basic 2008

推荐答案

您可以减去两个DateTime对象.尝试 laterDateTime.Subtract(earlierDateTime).这将产生一个TimeSpan对象,该对象具有"TotalSeconds"和"TotalMilliseconds"之类的属性.
You can subtract two DateTime objects. Try laterDateTime.Subtract(earlierDateTime). That will produce a TimeSpan object that has properties like "TotalSeconds" and "TotalMilliseconds".


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

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