From 03d06437b3674bcea556a64d64b056945702e421 Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Tue, 8 Jan 2019 06:36:58 +0000 Subject: [PATCH] Update status_dhcpv6_leases.php Fix to correct UTC and local time corerctly. Invert the local/gmt selection and subtract the offset rather than add corrects it. --- src/www/status_dhcpv6_leases.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/www/status_dhcpv6_leases.php b/src/www/status_dhcpv6_leases.php index 6ca37ea07..3e030266b 100644 --- a/src/www/status_dhcpv6_leases.php +++ b/src/www/status_dhcpv6_leases.php @@ -50,11 +50,11 @@ function adjust_gmt($dt) $timezone = $config['system']['timezone']; $ts = strtotime($dt . " GMT"); - if ($dhcpv6leaseinlocaltime == "yes") { + if ($dhcpv6leaseinlocaltime != "yes") { $this_tz = new DateTimeZone($timezone); $dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz); $offset = $this_tz->getOffset($dhcp_lt); - $ts = $ts + $offset; + $ts = $ts - $offset; return strftime("%Y/%m/%d %I:%M:%S%p", $ts); } else { return strftime("%Y/%m/%d %H:%M:%S", $ts);