Skip to content

Commit

Permalink
Show handshake timestamp in system timezone (opnsense#2204)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Greelan authored Jan 27, 2021
1 parent 2ff11c5 commit 8f66033
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/wireguard/src/www/widgets/widgets/wireguard.widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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; ?>

Expand Down

0 comments on commit 8f66033

Please sign in to comment.