#4841·gf

os/gtime: 从数据库读取出来的时间 映射到gtime类型的字段后 使用Unix()方法会增加8小时 没有时区

Author: 103337373Created Aug 11, 2026Updated Sep 9, 2026
Labelsbug

Go version

go1.26.2 windows/amd64

GoFrame version

v2.10.2

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

Image这个是数据库字段和值, var test *entity.Test dao.Test.Ctx(ctx).Scan(&test) fmt.Println(test.Time, "===")2026-08-11 13:17:15 === fmt.Println(test.Time.Unix(), "===")//1786454235

Image

What did you see happen?

Image时间戳多了八个小时

What did you expect to see?

期望得到正常的时间戳