Added explicit timezone loading

This commit is contained in:
Seednode 2023-07-17 07:41:32 -05:00
parent 871851d138
commit 7c93fc8c37
2 changed files with 10 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import (
) )
const ( const (
Version string = "0.53.1" Version string = "0.53.2"
) )
var ( var (

View File

@ -1046,6 +1046,15 @@ func serveVersion() httprouter.Handle {
} }
func ServePage(args []string) error { func ServePage(args []string) error {
timeZone := os.Getenv("TZ")
if timeZone != "" {
var err error
time.Local, err = time.LoadLocation(timeZone)
if err != nil {
return err
}
}
bindHost, err := net.LookupHost(bind) bindHost, err := net.LookupHost(bind)
if err != nil { if err != nil {
return err return err