18位时间戳? [英] 18 digit timestamp?

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

问题描述

我正在研究与电视录像有关的系统.

I am working on a system related to tv recordings.

我正在从另一个系统(我没有相关文档)解析以下xml:

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" />

我的问题是,有人可以识别StartTime和StopTime属性的时间戳格式吗?我认为通常到第二个的时间戳有10位数字,那么其他8个是哪里来的呢?我的猜测像是时区和毫秒精度.

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.

我使用的是php,因此将其转换为日期时间的特定于php的方式会很好,但是一切都很好.

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

推荐答案

它看起来像C#的DateTime滴答声:

It looks like C#'s DateTime ticks:

DateTime值类型表示 日期和时间,值范围 从1月1日午夜12:00:00开始 0001安诺·多米尼(共同时代) 9999年12月31日下午11:59:59 (C.E.)

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.)

此行:

Console.WriteLine (new DateTime (633936042047633656));

打印:

2009年11月12日上午6:30:04

11/12/2009 6:30:04 AM

如果需要将这些数字转换为Unix时间,请减去621355968000000000L,这是用 ticks 表示的Unix时期.

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

这篇关于18位时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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