Quickbooks 我的时间文件中的奇怪日期时间表示
我正在尝试处理 Quickbooks My Time 使用 PHP 的 imt 文件。 imt 文件是纯文本 XML 文件。我已经能够使用 PHP SimpleXML 库,没有任何问题,除了一个问题:
My Time XML 文件中日期时间的数字表示是我以前从未见过的:
<object type="TIMEPERIOD" id="z128">
<attribute name="notes" type="string"></attribute>
<attribute name="start" type="date">308073428.00000000000000000000</attribute>
<attribute name="running" type="bool">0</attribute>
<attribute name="duration" type="double">3600</attribute>
<attribute name="datesubmitted" type="date">310526237.59616601467132568359</attribute>
<relationship name="activity" type="1/1" destination="ACTIVITY" idrefs="z130"></relationship>
</object>
您可以看到 attritube[@name=' start'] 的值为:
308073428.00000000000000000000
这不是基于 Excel 的存储方法 308,073,428 自 1900-01-00 以来的天数太多,也不是 Unix Epoch。
所以,我的问题是,有人见过这种类型的日期时间表示吗?
I'm attempting to process Quickbooks My Time imt files using PHP. The imt file is a plaintext XML file. I've been able to use the PHP SimpleXML library with no issues but one:
The numeric representations of datetime in the My Time XML files is something I've never seen before:
<object type="TIMEPERIOD" id="z128">
<attribute name="notes" type="string"></attribute>
<attribute name="start" type="date">308073428.00000000000000000000</attribute>
<attribute name="running" type="bool">0</attribute>
<attribute name="duration" type="double">3600</attribute>
<attribute name="datesubmitted" type="date">310526237.59616601467132568359</attribute>
<relationship name="activity" type="1/1" destination="ACTIVITY" idrefs="z130"></relationship>
</object>
You can see that attritube[@name='start'] has a value of:
308073428.00000000000000000000
This is not Excel based method of storage 308,073,428 is too many days since 1900-01-00 and it isn't Unix Epoch either.
So, my question is, has anyone ever seen this type of datetime representation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 Quickbooks My Time imt 正在使用某些版本的 OS X Core Data 来存储应用程序信息。经过一段时间的研究,我发现 Core Data/Cocoa 使用 2000-01-01 00:00:00 作为其纪元的开始时间。因此,只需将秒添加到纪元即可获得正确的日期:
这足以获得正确的日期,但是,我仍然不确定如何处理小数点右侧的值有效时间。
It looks like Quickbooks My Time imt is using some version of OS X Core Data to store the application information. After digging around for awhile, I found that Core Data/Cocoa uses 2000-01-01 00:00:00 as the start time for their epoch. Therefore, it's simply a matter of adding the seconds to the epoch to get the correct date:
This is good enough to get the correct date, however, I'm still not certain how to process the values to the right of the decimal point for a valid time.