TimeOfDay.TotalHours [英] TimeOfDay.TotalHours

查看:119
本文介绍了TimeOfDay.TotalHours的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过使用DateTime TotalHours来获取一天中的总小时数,同时读取当前时间(现在),并将其与存储的DateTime值进行比较,方法是使用存储的值TotalHours或从中减去Now值.在任一情况下 大约有8个小时的滞后时间.换句话说,它显示8个小时,然后将储值更改30分钟左右,使总小时数变为负数?这不是时间极性,对于减法,我检查了要减去的较大值 来自任何解释,谢谢.

I attempted to get the total hours of the day by the use of DateTime TotalHours while reading the current time (Now) and compare it to a stored DateTime value, either by using the stored value TotalHours or subtracting it from the Now value. In either case there is a lag time of about eight hours In other words it showed 8 hours and then  changing the stored value by 30 minutes or so the total number of hours went negative? It is not the time polarity, for the subtract I checked the larger value to be subtracted from, any explanation, thank you.

AliReza Bemanian博士

AliReza Bemanian, Ph.D.

推荐答案

DateTime没有TotalHours属性,尽管Timespan类具有.

The DateTime doesn't have a TotalHours property, although the Timespan class does.

能否请您发布一些示例代码来说明您的意思?

Can you please post some example code demonstrating what you mean?


这篇关于TimeOfDay.TotalHours的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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