From bafb13cf06c86d00dd2923a1ef82ca364283977e Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Mon, 20 Apr 2026 21:46:55 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20scratch=20=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=20time.Local=20=E9=BB=98=E8=AE=A4=20UTC=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=94=B6=E5=85=A5=E7=BB=9F=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=AA=97=E5=8F=A3=E5=81=8F=E7=A7=BB=208=20=E5=B0=8F?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: claude-flow --- ppanel.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ppanel.go b/ppanel.go index a2e8110..7fb787d 100644 --- a/ppanel.go +++ b/ppanel.go @@ -1,6 +1,20 @@ package main -import "github.com/perfect-panel/server/cmd" +import ( + "time" + + "github.com/perfect-panel/server/cmd" +) + +func init() { + // Ensure time.Local matches DSN loc=Asia/Shanghai. + // In scratch Docker images, Go defaults to UTC even with TZ set, + // causing time range queries to shift by 8 hours. + loc, err := time.LoadLocation("Asia/Shanghai") + if err == nil { + time.Local = loc + } +} func main() { cmd.Execute()