Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
The Question has been closedby
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: 127.0.0.1 - - [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: 127.0.0.1 - - [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.
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.
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.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/6/13, 4:16 AM|
|Seen: 9793 times|
|Last updated: 3/16/15, 8:10 AM|