Closed liaohongxing closed 10 months ago
v2.3.1 will support tz
tag and will be released soon
v2.3.1 has been released
example code , test fail
PS F:\Software\time-test> go run .
panic: time: missing Location in call to Time.In
goroutine 1 [running]:
time.Time.In(...)
C:/Program Files/Go/src/time/time.go:1146
github.com/golang-module/carbon/v2.Carbon.ToStdTime(...)
C:/Users/DELL/go/pkg/mod/github.com/golang-module/carbon/v2@v2.3.1/outputer.go:822
github.com/golang-module/carbon/v2.Carbon.Timezone({{0x0, 0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, 0x0, 0x0, {0x0, ...}})
C:/Users/DELL/go/pkg/mod/github.com/golang-module/carbon/v2@v2.3.1/getter.go:381 +0xee
main.main()
F:/Software/time-test/main.go:22 +0xd8
exit status 2
Usage error, must load the tag through the LoadTag
method before json.Marshal
or json.Unmarshal
, please refer to README.md
It's already working , thinks !
golang version: 1.21
carbon version: 2.3.0
希望得到一样的时区:
而我得到了UTC时区: