diff options
-rw-r--r-- | admin/WebConsole/rest/common.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/admin/WebConsole/rest/common.php b/admin/WebConsole/rest/common.php index 826e57b7..8d192035 100644 --- a/admin/WebConsole/rest/common.php +++ b/admin/WebConsole/rest/common.php @@ -14,6 +14,12 @@ // Common constants. define('REST_LOGFILE', '/opt/opengnsys/log/rest.log'); +// Set time zone. +if (function_exists("date_default_timezone_set")) { + if (exec("timedatectl status | awk '/Time zone/ {print $3}'", $out, $err)) { + date_default_timezone_set($out[0]); + } +} // Common functions. |