feat(common): 设置时区为亚洲/上海

- 在 cool.go 中添加了 gtime.SetTimeZone("Asia/Shanghai")
- 在 config.yaml 中添加了 timezone: "Asia/Shanghai"
This commit is contained in:
2025-08-30 01:10:38 +08:00
parent 7b5ec208fc
commit 2ed5c2db27
2 changed files with 6 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/gogf/gf/v2/os/gbuild"
"github.com/gogf/gf/v2/os/gcache"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/guid"
"gorm.io/gorm"
)
@@ -24,6 +25,10 @@ var (
)
func init() {
err := gtime.SetTimeZone("Asia/Shanghai")
if err != nil {
panic(err)
}
var (
ctx = gctx.GetInitCtx()
redisConfig = &gredis.Config{}

View File

@@ -19,6 +19,7 @@ database:
pass: "hCnKjZRp3jnewzbS"
name: "seer"
debug: true
timezone: "Asia/Shanghai"
createdAt: "createTime"
updatedAt: "updateTime"
# deletedAt: "deleteTime"