dsm42026 2009-12-02 12:50
浏览 116
已采纳

18位数的时间戳?

I am working on a system related to tv recordings.

I am parsing the following xml from another system (to which i have no documentation):

<Program FileName="2009.11.07-Saturday 07 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633931722046825183" StopTime="633932388000119414" ActualStopTime="633932388016825183" ShareShow="True" />
<Program FileName="2009.11.08-Sunday 08 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633932586046773253" StopTime="633933252000157907" ActualStopTime="633933252006773253" ShareShow="True" />
<Program FileName="2009.11.09-Monday 09 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633933450046168953" StopTime="633934116000207688" ActualStopTime="633934116026168953" ShareShow="True" />
<Program FileName="2009.11.10-Tuesday 10 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633934314046899495" StopTime="633934980000869533" ActualStopTime="633934980096899495" ShareShow="True" />
<Program FileName="2009.11.11-Wednesday 11 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633935178054202612" StopTime="633935844000077447" ActualStopTime="633935844064202612" ShareShow="True" />
<Program FileName="2009.11.12-Thursday 12 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633936042047633656" StopTime="633936708000009191" ActualStopTime="633936708047633656" ShareShow="True" />

My question is, does anyone recognise the timestamp format of the StartTime and StopTime attributes? I thought typically timestamps to the second had 10 digits, so where are the other 8 coming from? My guess is something like timezone and millisecond accuracy.

I am using php, so a php specific way of converting it to a datetime would be nice, but anything is good.

  • 写回答

3条回答 默认 最新

  • duanrong5927 2009-12-02 12:59
    关注

    It looks like C#'s DateTime ticks:

    The DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Anno Domini (Common Era) through 11:59:59 P.M., December 31, 9999 A.D. (C.E.)

    This line:

    Console.WriteLine (new DateTime (633936042047633656));
    

    prints:

    11/12/2009 6:30:04 AM

    If you need to convert from those numbers to Unix time, substract 621355968000000000L, which is the Unix epoch expressed in ticks.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路