From 923e57baf3873fab194735099dfc55b8bffd6059 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Tue, 8 Nov 2016 23:23:15 +0100 Subject: [PATCH] try to fix https://github.com/dg9vh/MMDVMHost-Dashboard/issues/63 --- txinfo.php | 7 ++++--- version.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/txinfo.php b/txinfo.php index 9665748..f57660f 100644 --- a/txinfo.php +++ b/txinfo.php @@ -8,6 +8,8 @@ include "include/functions.php"; $mmdvmconfigs = getMMDVMConfig(); if (!defined("MMDVMLOGPREFIX")) define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs)); +if (!defined("TIMEZONE")) + define("TIMEZONE", "UTC"); $logLinesMMDVM = getShortMMDVMLog(); $reverseLogLinesMMDVM = $logLinesMMDVM; array_multisort($reverseLogLinesMMDVM,SORT_DESC); @@ -44,9 +46,8 @@ foreach ($lastHeard as $listElem) { }else{ echo"$listElem[6]"; } - $UTC = new DateTimeZone("UTC"); - $d1 = new DateTime($listElem[0], $UTC); - $d2 = new DateTime('now', $UTC); + $d1 = new DateTime($listElem[0], new DateTimeZone(TIMEZONE)); + $d2 = new DateTime('now', new DateTimeZone(TIMEZONE)); $diff = $d2->getTimestamp() - $d1->getTimestamp(); echo"$diff s"; } else { diff --git a/version.php b/version.php index 090e0ff..2326314 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@