odoo 获取Datatime字段的时间值,比系统时间少8个小时,
-
你得告诉我们是怎么存的时间,界面上存的还是程序中存的。
在数据库中存的都是UTC时间,也就是比北京时区少8个小时。当显示的时候会根据用户的时区设置转换为用户所在时区的时间。

-
你得告诉我们是怎么存的时间,界面上存的还是程序中存的。
在数据库中存的都是UTC时间,也就是比北京时区少8个小时。当显示的时候会根据用户的时区设置转换为用户所在时区的时间。

@digitalsatori 在程序中存取的,在odoo界面上显示正常,当我从odoo模型中取出相应的时间,返回给小程序前端的时候,少了8小时,现在已经解决,方法很粗暴,返回时,如果有值就加8个小时返回。谢谢
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login