-
Notifications
You must be signed in to change notification settings - Fork 153
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
time.Time 读出时间差8小时,有办法统一处理吗? #123
Comments
@15951836388 |
之前说错了,time.Time ,读写 没问题。 只是再读出来,差8小时。希望读出来和写进去的值一样,有办法吗? |
时区问题,自己 |
@15951836388 有后续么? 数据库查询统一返回 UTC 可以适应各种场景(归根结底时区这件事情,业务层是应当感知的),这也是 globalsign/mgo 做这个更改 的原因。如果可以解决你的问题最好。 |
没有解决。存进去的是什么,读出来的就应该是什么。 如果一个很复杂的角色对象数据,在业务层每次都要额外处理,心里负担,也是不太适合的。还是希望能有办法统一处理。 |
遵循MongoDB官方driver和 globalsign/mgo 行为,我们暂时不对时区做处理了,保持UTC |
国情不一样吧. 国内的谁看utc时间. 如果只面对国内的业务, 再弄个utc就没必要了. |
后续万一业务发生扩展,而系统没有提前「麻烦」一点,那会有得好受,不要问我(们)怎么知道的 ;-) |
time.Time 读出时间差8小时,有办法统一处理吗
The text was updated successfully, but these errors were encountered: