mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 10:04:41 +00:00
Update status_dhcpv6_leases.php
Fix to correct UTC and local time corerctly. Invert the local/gmt selection and subtract the offset rather than add corrects it.
This commit is contained in:
parent
5a95ccfef3
commit
03d06437b3
@ -50,11 +50,11 @@ function adjust_gmt($dt)
|
||||
|
||||
$timezone = $config['system']['timezone'];
|
||||
$ts = strtotime($dt . " GMT");
|
||||
if ($dhcpv6leaseinlocaltime == "yes") {
|
||||
if ($dhcpv6leaseinlocaltime != "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 = $ts - $offset;
|
||||
return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
|
||||
} else {
|
||||
return strftime("%Y/%m/%d %H:%M:%S", $ts);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user