18 digit timestamp?

I am working on a television recording system.

I am parsing the following xml from another system (for 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 recognize the timestamp format of the StartTime and StopTime attributes? I thought the timestamps for the second have 10 digits, so where are the other 8? My hunch is like a time zone and millisecond accuracy.

I use php, so a special way to convert it to datetime would be nice, but all is well.

+3
source share
3 answers

It looks like C # DateTime is ticking:

DateTime 12:00:00 , 1 , 0001 Anno Domini (Common Era) 11:59:59 P.M., 31 9999 A.D. (C.E.)

:

Console.WriteLine (new DateTime (633936042047633656));

:

11/12/2009 6:30:04 AM

Unix-, 621355968000000000L, Unix, .

+8

gmp lib, php, :

$epoch     = '621355968000000000';
$newtime   = gmp_sub($dateTime, $epoch);
$newtime   = gmp_div($newtime, '10000000');
$timestamp = gmp_strval($newtime);

:

echo date('Y-m-d H:i:s', $timestamp);
+2
$dateLargeInt= "131424999530821857";
$secsAfterADEpoch = $dateLargeInt / (10000000); 
$ADToUnixConvertor=((1970-1601) * 365.242190) * 86400;
// unix epoch - AD epoch * number of tropical days * seconds in a day 
$unixTsLastLogon=intval($secsAfterADEpoch-$ADToUnixConvertor); 

// unix Timestamp version of AD timestamp
$lastlogon=date("d-m-Y", $unixTsLastLogon); // formatted date

echo $lastlogon;
+1
source

Source: https://habr.com/ru/post/1724494/


All Articles