fix: 修复 scratch 容器中 time.Local 默认 UTC 导致收入统计时间窗口偏移 8 小时
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
parent
9a8ae8b6fd
commit
bafb13cf06
16
ppanel.go
16
ppanel.go
@ -1,6 +1,20 @@
|
|||||||
package main
|
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() {
|
func main() {
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user