From aca9ffc122d433edcb79a811b456ee07af3ca5e9 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 26 Jan 2021 20:36:46 -0800 Subject: [PATCH] Use TZ environment variable if present; closes pterodactyl/panel#3036 --- config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/config.go b/config/config.go index d79dd83..7f28d8f 100644 --- a/config/config.go +++ b/config/config.go @@ -568,6 +568,10 @@ func (sc *SystemConfiguration) GetStatesPath() string { // // This function IS NOT thread-safe. func ConfigureTimezone() error { + tz := os.Getenv("TZ") + if _config.System.Timezone == "" && tz != "" { + _config.System.Timezone = tz + } if _config.System.Timezone == "" { b, err := ioutil.ReadFile("/etc/timezone") if err != nil {