From 86a8eb16b4d17a02400d712ab218982d3b3d31cc Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 21 Apr 2026 20:05:52 +0200 Subject: [PATCH] fix timelocation for windows Co-Authored-By: Alireza Ahmadi --- 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 04d8f6a8..560dce3a 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -462,7 +462,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 }