Added the the choice for DHCPv6 leases of local time over default UTC time.

This commit is contained in:
Joecowboy 2012-02-25 15:32:18 -06:00
parent 7d1e0109eb
commit 468618f0da

View File

@ -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) {