diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php index ba18b72aff..a00c94ed95 100755 --- a/usr/local/www/status_dhcp_leases.php +++ b/usr/local/www/status_dhcp_leases.php @@ -44,6 +44,7 @@ ##|-PRIV require("guiconfig.inc"); +require_once("config.inc"); $pgtitle = array(gettext("Status"),gettext("DHCP leases")); @@ -94,8 +95,20 @@ function leasecmp($a, $b) { } function adjust_gmt($dt) { - $ts = strtotime($dt . " GMT"); - return strftime("%Y/%m/%d %H:%M:%S", $ts); + global $config; + $sysctl = $config['system']; + $timezone = $sysctl['timezone']; + $timeformatchange = $sysctl['timeformatchange']; + $ts = strtotime($dt . " GMT"); + if ($timeformatchange == "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); } function remove_duplicate($array, $field)