From 8f660333d6d7cf93bb1dcb3e037f9c8fc1d7afa8 Mon Sep 17 00:00:00 2001 From: Greelan <53196309+Greelan@users.noreply.github.com> Date: Wed, 27 Jan 2021 22:19:25 +1100 Subject: [PATCH] Show handshake timestamp in system timezone (#2204) This change shows each latest handshake time in the widget in the timezone of the system, rather than UTC as currently. The change is intended to implement this forum request: https://forum.opnsense.org/index.php?topic=20530.msg95463#msg95463. As a disclaimer, I am by no means a PHP programmer, but this commit is based on my research. It works when I tested it. --- net/wireguard/src/www/widgets/widgets/wireguard.widget.php | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireguard/src/www/widgets/widgets/wireguard.widget.php b/net/wireguard/src/www/widgets/widgets/wireguard.widget.php index 7da094ebcc..95bc8eab67 100644 --- a/net/wireguard/src/www/widgets/widgets/wireguard.widget.php +++ b/net/wireguard/src/www/widgets/widgets/wireguard.widget.php @@ -55,6 +55,7 @@ $latest = "-"; if ($epoch > 0): $dt = new DateTime("@$epoch"); + $dt->setTimezone(new DateTimeZone(date_default_timezone_get())); $latest = $dt->format(gettext("Y-m-d H:i:sP")); endif; ?>