summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-12-23 17:27:59 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-12-23 17:28:08 -0200
commit56301bed301dcbd2e3cd1f9efdd344df59f719b4 (patch)
tree97dcd740364c9865e1108670c6c34a576682e3a0 /usr
parentf2aa8287545d45ed22c44b5e2c102fb7a22658b0 (diff)
downloadpfsense-56301bed301dcbd2e3cd1f9efdd344df59f719b4.zip
pfsense-56301bed301dcbd2e3cd1f9efdd344df59f719b4.tar.gz
Fix DHCP lease time display, strftime already convert it to local timezone, so we no need to calc offset
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_dhcp_leases.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index 78733db..b7624d8 100755
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -99,22 +99,16 @@ function leasecmp($a, $b) {
function adjust_gmt($dt) {
global $config;
$dhcpd = $config['dhcpd'];
- foreach ($dhcpd as $dhcpleaseinlocaltime) {
- $dhcpleaseinlocaltime = $dhcpleaseinlocaltime['dhcpleaseinlocaltime'];
+ foreach ($dhcpd as $dhcpditem) {
+ $dhcpleaseinlocaltime = $dhcpditem['dhcpleaseinlocaltime'];
if ($dhcpleaseinlocaltime == "yes")
break;
}
- $timezone = $config['system']['timezone'];
- $ts = strtotime($dt . " GMT");
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;
+ $ts = strtotime($dt . " GMT");
return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
- }
- else
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
+ } else
+ return $dt;
}
function remove_duplicate($array, $field)
OpenPOWER on IntegriCloud