summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_dhcp_leases.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/status_dhcp_leases.php')
-rwxr-xr-xusr/local/www/status_dhcp_leases.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index a00c94e..f1dec97 100755
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -95,18 +95,22 @@ function leasecmp($a, $b) {
}
function adjust_gmt($dt) {
- global $config;
- $sysctl = $config['system'];
- $timezone = $sysctl['timezone'];
- $timeformatchange = $sysctl['timeformatchange'];
+ global $config;
+ $dhcpd = $config['dhcpd'];
+ foreach ($dhcpd as $dhcpleaseinlocaltime) {
+ $dhcpleaseinlocaltime = $dhcpleaseinlocaltime['dhcpleaseinlocaltime'];
+ if ($dhcpleaseinlocaltime == "yes")
+ break;
+ }
+ $timezone = $config['system']['timezone'];
$ts = strtotime($dt . " GMT");
- if ($timeformatchange == "yes") {
+ if ($dhcpleaseinlocaltime == "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;
return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
- }
+ }
else
return strftime("%Y/%m/%d %H:%M:%S", $ts);
}
OpenPOWER on IntegriCloud