hi-server/ppanel.go
shanshanzhong 9912df9ac6
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 4m56s
fix: 修复时区问题 - FixedZone 兜底 + Dockerfile 复制完整 zoneinfo
1. ppanel.go: LoadLocation 失败时用 FixedZone("CST", +8h) 兜底
2. Dockerfile: 复制完整 /usr/share/zoneinfo 目录,确保 go-sql-driver 也能加载 Asia/Shanghai

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-20 21:53:48 -07:00

23 lines
435 B
Go

package main
import (
"time"
"github.com/perfect-panel/server/cmd"
)
func init() {
// Ensure time.Local matches DSN loc=Asia/Shanghai.
// In scratch Docker images, LoadLocation may fail due to missing zoneinfo,
// so fall back to FixedZone as a guaranteed alternative.
loc, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
loc = time.FixedZone("CST", 8*3600)
}
time.Local = loc
}
func main() {
cmd.Execute()
}