mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Added choice of UTC time or local time for DHCP leases.
This commit is contained in:
parent
7d0ad4ec4d
commit
7d1e0109eb
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user