Odoo Help


Timezone issue in OpenERP 7.0 version [Closed]

Ghanshyam Prajapati
on 6/6/13, 4:16 AM 10,610 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 06/06/2013 05:29:53

Hi, I m working with OpenERP 7.0 Version, when I start OpenERP server it display current time on terminal.

2013-06-06 **05:33:32,972 2486** INFO my_module werkzeug: - - [06/Jun/2013 05:33:32] "GET /web/binary/image?model=res.partner&field=image_small&id=37&session_id=2683239f22164b0eba5cb58b0049b1dc HTTP/1.1" 304 -
2013-06-06 05:33:32,974 2486 INFO my_module werkzeug: - - [06/Jun/2013 05:33:32]

My actual system time is 2013-06-06 11:18:38 AM. I searched for my problem on Google and I found that OpenERP server takes default timezone GMT or login user's timezone.

I changed login user's timezone from Preferences 'Asia/Calcutta'(GMT +05:30), but still OpenERP server shows me GMT time.

Even when I use datetime.datetime.now().hour in my module, it gives wrong hour.

How can I solve this issue..?????

Please help me.

Thanks in advance.


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 6/6/13, 5:19 AM

Since OpenERP 6.1, the timezone of all Python operations happening on the server-side (and in modules) is forced to be UTC. This was a design decision explained in various places. The rendering of datetime values in the user's timezone is meant to be done on the client-side exclusively.

Reference: OpenERP Release Notes

If you want to convert time as per Users specific timezone then there is a method in OpenERP:

from openerp.osv import fields
from datetime import datetime
my_date = fields.datetime.context_timestamp(cr, uid, datetime.now(), context=context)
print "My Datetime: ", my_date
print "Hour: ", my_date.hour


My Datetime: 2013-06-06 12:28:22.249559+05:30
Hour: 12

Hope this will help you.

unfortunately the rendering to the users timezone does not work correctly everywhere. Attendances and timesheets are two examples (http://help.openerp.com/question/31908/how-to-get-attendance-be-assigned-to-the-correct-day-for-anyone-who-is-not-in-the-utc-timezone)

on 10/7/13, 10:44 PM

Hello Sudhir Arya, the fact that OpenERP allways records date & time in UTC in the database is a big problem. Im implementing point of sale and when I print a report, the report is just incorrect because in the DB changes the values, how is it posible to use the method above to write the correct time zone in the DB? Thanks in advance!!

MEXYTUL, Diego Calzadilla
on 1/22/14, 1:32 PM

I solved that problem by changing some line in orm.py, OpenERP doesn't record in UTC in DB, I changed to do it in CST

MEXYTUL, Diego Calzadilla
on 1/30/14, 2:48 PM

Hi Diego can you please explain ,How you solve this issue? I am also facing this issue ,bcz I am working with POS Module .So kindly help........

on 12/7/15, 10: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

3 follower(s)


Asked: 6/6/13, 4:16 AM
Seen: 10610 times
Last updated: 3/16/15, 8:10 AM