Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 新手求助
  4. odoo 获取Datatime字段的时间值,比系统时间少8个小时,

odoo 获取Datatime字段的时间值,比系统时间少8个小时,

Scheduled Pinned Locked Moved Odoo 新手求助
4 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kaola
    wrote on last edited by
    #1

    在字段里面时间存的时间和系统时间是一样的,取出来就少了8个小时,应该如何处理?得到正确打系统时间

    1 Reply Last reply
    0
    • D Offline
      D Offline
      digitalsatori
      管理员
      wrote on last edited by digitalsatori
      #2

      你得告诉我们是怎么存的时间,界面上存的还是程序中存的。

      在数据库中存的都是UTC时间,也就是比北京时区少8个小时。当显示的时候会根据用户的时区设置转换为用户所在时区的时间。

      Inbox_-_Odoo.png

      【上海先安科技】(tony AT openerp.cn)

      K 1 Reply Last reply
      0
      • K Offline
        K Offline
        kaola
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • D digitalsatori

          你得告诉我们是怎么存的时间,界面上存的还是程序中存的。

          在数据库中存的都是UTC时间,也就是比北京时区少8个小时。当显示的时候会根据用户的时区设置转换为用户所在时区的时间。

          Inbox_-_Odoo.png

          K Offline
          K Offline
          kaola
          wrote on last edited by
          #4

          @digitalsatori 在程序中存取的,在odoo界面上显示正常,当我从odoo模型中取出相应的时间,返回给小程序前端的时候,少了8小时,现在已经解决,方法很粗暴,返回时,如果有值就加8个小时返回。谢谢

          1 Reply Last reply
          0

          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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Tags
          • Popular
          • Users
          • Groups