summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoecowboy <i7wasn7m3@gmail.com>2012-02-25 15:32:18 -0600
committerJoecowboy <i7wasn7m3@gmail.com>2012-02-25 15:32:18 -0600
commit468618f0da3cd02bf6e10144fc1d696e9fa40737 (patch)
tree13cb6e7cd5a2555cad68602d3b929aef0afb005b
parent7d1e0109ebcb34603e27a05085df239dad7d3a7a (diff)
downloadpfsense-468618f0da3cd02bf6e10144fc1d696e9fa40737.zip
pfsense-468618f0da3cd02bf6e10144fc1d696e9fa40737.tar.gz
Added the the choice for DHCPv6 leases of local time over default UTC time.
-rw-r--r--usr/local/www/status_dhcpv6_leases.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php
index 6153259..c4d7aa7 100644
--- a/usr/local/www/status_dhcpv6_leases.php
+++ b/usr/local/www/status_dhcpv6_leases.php
@@ -45,6 +45,7 @@
##|-PRIV
require("guiconfig.inc");
+require_once("config.inc");
$pgtitle = array(gettext("Status"),gettext("DHCPv6 leases"));
@@ -95,8 +96,20 @@ function leasecmp($a, $b) {
}
function adjust_gmt($dt) {
+ global $config;
+ $sysctl = $config['system'];
+ $timezone = $sysctl['timezone'];
+ $timeformatchangev6 = $sysctl['timeformatchangev6'];
$ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
+ if ($timeformatchangev6 == "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) {
OpenPOWER on IntegriCloud