Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/service/setting.go')
-rw-r--r--web/service/setting.go7
1 files changed, 6 insertions, 1 deletions
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
}