This commit is contained in:
vipg
2026-02-10 11:01:17 +08:00
parent 8eb9adda68
commit b3ac9e8060
3 changed files with 12 additions and 3 deletions

View File

@@ -72,7 +72,14 @@ func SetupTimezone(tz string) error {
}
loc, err := time.LoadLocation(tz)
if err != nil {
return err
// fallback for alpine without tzdata
switch tz {
case "Asia/Shanghai", "PRC", "CST":
time.Local = time.FixedZone("CST", 8*3600)
return nil
default:
return err
}
}
time.Local = loc
return nil