Timezone issue in OpenERP 7.0 version


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 in my module, it gives wrong hour.

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

Please help me.

Thanks in advance.

1 Answer

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,, 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 (

Diego Calzadilla

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!!

Diego Calzadilla

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


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........