From b8f2195a3ae79287c3941da34c046e1731f7630d Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 2 Feb 2026 16:41:51 +0100 Subject: [PATCH] fix timelocation for windows --- web/service/setting.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/service/setting.go b/web/service/setting.go index 303cddaa..3cef9e76 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -359,7 +359,12 @@ func (s *SettingService) GetTimeLocation() (*time.Location, error) { if err != nil { defaultLocation := defaultValueMap["timeLocation"] logger.Errorf("location <%v> not exist, using default location: %v", l, defaultLocation) - return time.LoadLocation(defaultLocation) + location, err = time.LoadLocation(defaultLocation) + if err != nil { + logger.Errorf("failed to load default location, using UTC: %v", err) + return time.UTC, nil + } + return location, nil } return location, nil }