Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用gtime作为参数进行查询时区不正确 #1895

Closed
tiansin opened this issue Jun 7, 2022 · 2 comments
Closed

使用gtime作为参数进行查询时区不正确 #1895

tiansin opened this issue Jun 7, 2022 · 2 comments

Comments

@tiansin
Copy link
Contributor

tiansin commented Jun 7, 2022

@gqcn 这个问题和之前提交过的问题一模一样,只是这次gtime也有这个问题了.

v2.06正式没有这个问题,问题是在 v2.1.0-rc4 中出现.

#1013 (comment)

@tiansin
Copy link
Contributor Author

tiansin commented Jun 7, 2022

我通过跟踪发现了产生这个问题的原因,应该是这里说的time.Time参数会被底层转换问题. #1013 (comment)

v2.06

newArgs = append(newArgs, v.String())

newArgs = append(newArgs, v.String())

v2.10-rc4

newArgs = append(newArgs, arg.(gtime.Time).Time)

newArgs = append(newArgs, arg.(*gtime.Time).Time)

@tiansin
Copy link
Contributor Author

tiansin commented Jun 7, 2022

研究了下数据库底层连接代码,如果数据库配置是用link增加?loc=Asia%2FShanghai参数
如果是用配置项则增加timezone = "Asia/Shanghai" 解决.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant