Commit cbbac3b7 authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

bugfix: more timezone fixes

parent b9bc99e4
......@@ -432,11 +432,9 @@ function load_LinkedTO($node_info, $TopoList)
function build_Marker($node_info, $node_ServiceList, $node_LinkedList, $node_FirmwareStatus)
{
//timezone fixes - wxc 11-26-2018
$tz = new DateTimeZone($GLOBALS['USER_SETTINGS']['localTimeZone']);
//$nodeLastSeen = date_create($node_info['last_seen'], $tz);
//timezone fixes - wxc 11-27-2018
$nodeLastSeen = new DateTime($node_info['last_seen']);
date_timezone_set($nodeLastSeen, $tz);
date_timezone_set($nodeLastSeen, $GLOBALS['localTimeZone']);
$markerList = '';
......@@ -1104,8 +1102,7 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal
$filetime = wxc_scriptGetLastDateTime("LINKINFO", "topology");
if ($filetime)
{
$tz = new DateTimeZone($GLOBALS['USER_SETTINGS']['localTimeZone']);
date_timezone_set($filetime, $tz);
date_timezone_set($filetime, $GLOBALS['localTimeZone']);
$filetime = date_format($filetime, 'F d Y H:i:s T');
}
......
......@@ -491,11 +491,10 @@ function wxc_scriptGetLastDateTime ($id, $name) {
return 0;
}
//timezone fixes - wxc 11-26-2018
$tz = new DateTimeZone($GLOBALS['USER_SETTINGS']['localTimeZone']);
//timezone fixes - wxc 11-27-2018
$datetime = new DateTime($lastRunSelf['script_last_run']);
date_timezone_set($datetime, $tz);
//return date_create($lastRunSelf['script_last_run']);
date_timezone_set($datetime, $GLOBALS['localTimeZone']);
return $datetime;
}
......
......@@ -48,10 +48,13 @@ if (!isset($_SESSION['userLoggedIn'])) {
// echo "<th onclick=\"sortTable(4)\"><boldText>Lon</boldText></th>\n";
echo "</tr>\n";
foreach ($ignoredNodes as $value) {
$tz = new DateTimeZone($GLOBALS['USER_SETTINGS']['localTimeZone']);
$datetime = new DateTime($value['timestamp'], $tz);
echo "\n<tr><td>" . $value['ip'] . "</td>" .
"<td>" . $value['name'] . "</td>" .
"<td>" . $value['reason'] . "</td>" .
"<td>" . $value['timestamp'] . "</td>" .
"<td>" . date_format($datetime, 'Y-m-d H:i:s T') . "</td>" .
// "<td>" . $value['timestamp'] . "</td>" .
// "<td>" . $value['lon'] . "</td>" .
"<td>" .
"<form class='remove_ignored_node_form' action='view_ignored_nodes.php' method='post'>" .
......
......@@ -33,9 +33,12 @@ if (!isset($_SESSION['userLoggedIn'])) {
// echo "<th onclick=\"sortTable(4)\"><boldText>Lon</boldText></th>\n";
echo "</tr>\n";
foreach ($removedNodes as $value) {
$tz = new DateTimeZone($GLOBALS['USER_SETTINGS']['localTimeZone']);
$lastSeen = new DateTime($value['last_seen'], $tz);
$timeRemoved = new DateTime($value['time_removed'], $tz);
echo "\n<tr><td>" . $value['node'] . "</td>" .
"<td>" . $value['last_seen'] . "</td>" .
"<td>" . $value['time_removed'] . "</td>" .
"<td>" . date_format($lastSeen, 'Y-m-d H:i:s T') . "</td>" .
"<td>" . date_format($timeRemoved, 'Y-m-d H:i:s T') . "</td>" .
// "<td>" . $value['lat'] . "</td>" .
// "<td>" . $value['lon'] . "</td>" .
"<td></td>" .
......
......@@ -73,8 +73,9 @@ if (file_exists($INCLUDE_DIR . "/scripts/meshmap-settings.ini")) {
require $INCLUDE_DIR . "/scripts/wxc_functions.inc";
require $INCLUDE_DIR . "/scripts/map_functions.inc";
//commented out for timezone fizes -wxc 11-26-2018
//date_default_timezone_set($USER_SETTINGS['localTimeZone']);
//commented out for timezone fizes -wxc 11-27-2018
global $tz;
$tz = new DateTimeZone($USER_SETTINGS['localTimeZone']);
/*
* This section will try to tell if the client has internet access or not
......
......@@ -184,6 +184,9 @@ if (is_array($NodeList) && !empty($NodeList))
echo "<tbody>\n\n";
foreach ($NodeList as $Node)
{
$tz = new DateTimeZone($USER_SETTINGS['localTimeZone']);
$datetime = new DateTime($Node['last_seen']);
date_timezone_set($datetime, $tz);
$node_FirmwareStatus = checkVersion($Node['firmware_version'], $STABLE_MESH_VERSION);
/*
* If you add columns here, make sure to add them to display_HeaderTitles()
......@@ -215,8 +218,7 @@ if (is_array($NodeList) && !empty($NodeList))
}
echo "<td>" . $firmware . "</td>\n";
echo "<td align=\"center\">"
. $Node['last_seen']
." GMT"
. date_format($datetime, 'F d Y H:i:s T')
."</td>\n";
//added kg6wxc may 2018
/*****START*****/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment