Odoo Help


Current Date in QWEB Report with user timezone

on 2/13/15, 6:48 PM 17,337 views

how can I get the current date with the correct timezone of the user printing the report?

I am using this, but this brings the current UTC time.
<span t-esc="time.strftime('%Y-%m-%d %H:%M:%S')"/>

Vince Vinet
On 4/23/15, 3:52 PM

I have just created a module which allows you do to:

<span t-usertime="%Y-%m-%d %H-%M-%S" /> 

and get the correct timezone. See it on GitHub 

This has now been accepted in the OCA addons. Updated the github link.

Savoir-Faire Linux, Vince Vinet
on 5/11/15, 10:06 AM
On 3/8/17, 10:18 PM
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>   

This should be the correct answer

Andre de Kock
on 8/25/17, 7:48 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

5 follower(s)


Asked: 2/13/15, 6:48 PM
Seen: 17337 times
Last updated: 7/18/18, 8:32 AM