如何“变异时间” (DATE,double,8-byte)处理? [英] How is "variant time" (DATE, double, 8-byte) handled?

查看:158
本文介绍了如何“变异时间” (DATE,double,8-byte)处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到任何有关变体时间的信息( DATE ,double,8-byte variable )。
我有一个变体时间 / strong>,其值为 41716.892329
如果我使用转换 A VariantTimeToSystemTime (或 COleDateTime ) - 我得到 2014-03-18 21:24:57




  • 如何计算此变体时间? / li>
  • 是否能够存储毫秒?

  • 有无法确定变体时间是上午还是下午时间?



我对AM / PM的事情感到困惑,因为我当时使用的设备设置为 09 :24:57(AM),而不是 21 :24:57(PM)。



这可能是设备SDK为我提供了不正确的变体时间的问题吗?



EDIT :这是设备中设置的时区不正确的问题(设置为GMT-12:00而不是GMT-00:00)



谢谢。

解决方案

好的,我想我找到了所有的答案!
Simon Mourier评论说,41716.892329真的是2014-03-18 21 :24:57,这就是为什么 - 看起来变体时间是这样分割: 日期)41716。(时间)892329。
如果你取0.892329并乘以24.0,我们将得到 21 ,415896其中 21 是我的小时值。



我已经找到一些关于如何自己计算这个变种时间的信息:
http://doxygen.reactos.org/df/d85/variant_8c_source.html - (在 VarUdateFromDate 函数中)



看起来变体时间能够处理毫秒,它只是像 VariantTimeToSystemTime 忽略它们(可能是因为缺少精度原因?)。函数只是舍入毫秒,如果需要,可以向前调整日期时间。
(因此,如果我们输入时间为21:24:57。 567 ,输出时间将为21:24: 58 p>

在这里找到一些有趣的资料: http://www.codeproject.com/Articles/17576/SystemTime-to-VariantTime-with-Milliseconds - SystemTime到VariantTime with Milliseconds


I can't seem to find any information on how a "variant time" (DATE, double, 8-byte variable) is handled.... I have a variant time "A" which value is "41716.892329". If I convert "A" using "VariantTimeToSystemTime" (or "COleDateTime") - I get "2014-03-18 21:24:57".

  • How is this variant time calculated?
  • Is it capable of storing milliseconds?
  • Is there any way to determine if variant time is an AM or PM time?

I'm a bit confused regarding the AM/PM thing because the device that I'm working with at that moment was set to "09:24:57" (AM) and not "21:24:57" (PM).

Can this be a problem of the device SDK that provides me with an incorrect variant time?

EDIT: This was a problem of incorrect timezone set in the device (was set to "GMT-12:00" instead of "GMT-00:00")

Thanks.

解决方案

Ok, I think I've found all of my answers! As Simon Mourier commented, "41716.892329" is really "2014-03-18 21:24:57" and this is why - it looks like variant time is split like this: "(date) 41716 . (time) 892329". If you take "0.892329" and multiply it by 24.0, we will get 21,415896 where "21" is my hours value.

I've found some information on how to calculate this variant time on your own here: http://doxygen.reactos.org/df/d85/variant_8c_source.html - (in the "VarUdateFromDate" function)

It looks like variant time is capable of handling milliseconds, it's just functions like "VariantTimeToSystemTime" ignores them (maybe for the lack of precision reasons?). Function just rounds the milliseconds, adjusting the date-time forward if needed. (So in case we have input time "21:24:57.567", output time will be "21:24:58".

Found some interesting material here: http://www.codeproject.com/Articles/17576/SystemTime-to-VariantTime-with-Milliseconds - "SystemTime to VariantTime with Milliseconds".

这篇关于如何“变异时间” (DATE,double,8-byte)处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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