5
/* DS: Rewrite with bcmath for 32bit system compatibility */
10
const START = 621355968000000000;
12
function __construct(&$reader, $correction = 0) {
13
$this->reader = &$reader;
14
if (is_int($correction)) $this->correction = $correction;
15
else $this->correction = 0;
18
function ImportTime($dt) {
19
return (int)floor(10000000*$dt->format("U.u")) + MSTICKS::START - $this->correction;
22
function ExportTime($db_time) {
23
global $adei_profiler;
25
$ticks = ($db_time - MSTICKS::START + $this->correction);
27
$ns100 = $ticks % 10000000;
28
$timestamp = ($ticks - $ns100) / 10000000;
31
$len = strlen($ns100);
32
if ($len < 7) $ns100 = str_repeat('0', 7 - $len) . $ns100;
34
return new DateTime(strftime("%Y/%m/%d %H:%M:%S", $timestamp) . ".$ns100", $this->reader->gmt_timezone);
36
return new DateTime("@$timestamp", $this->reader->gmt_timezone);
b'\\ No newline at end of file'