{"id":889,"date":"2022-02-08T19:26:44","date_gmt":"2022-02-08T13:26:44","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=889"},"modified":"2022-02-08T19:26:44","modified_gmt":"2022-02-08T13:26:44","slug":"how-to-manipulate-time-in-odoo-qweb-report","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-manipulate-time-in-odoo-qweb-report.html","title":{"rendered":"How to manipulate time in Odoo Qweb Report"},"content":{"rendered":"\n<p>In Odoo Qweb report, you probably want to change the time to something else, like add few hours, or change the timezone, or so on. To do that, you would need to use &#8216;t-esc&#8217; template attribute of Odoo. Here is an example of how to add 6 hours to the original timestamp and then convert the time to string to show the value according to the user preference:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;span t-esc=\"(o.date_done + datetime.timedelta(hours=6)).strftime('%d\/%m\/%Y %I:%M %p')\"\/><\/pre>\n\n\n\n<p>o.date_done is getting the date_done from the picking that you are visiting. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Odoo Qweb report, you probably want to change the time to something else, like add few hours, or change the timezone, or so on. To do that, you would need to use &#8216;t-esc&#8217; template attribute of Odoo. Here is an example of how to add 6 hours to the original timestamp and then convert &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-manipulate-time-in-odoo-qweb-report.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to manipulate time in Odoo Qweb Report&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[292],"tags":[679,297,677,574],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/889"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=889"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/889\/revisions"}],"predecessor-version":[{"id":890,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/889\/revisions\/890"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}