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):
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.
With the gmp lib installed in php you can do it like this:
$epoch = '621355968000000000';
$newtime = gmp_sub($dateTime, $epoch);
$newtime = gmp_div($newtime, '10000000');
$timestamp = gmp_strval($newtime);
and now you got a date:
echo date('Y-m-d H:i:s', $timestamp);
$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;