Odoo Help


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


Datetime and Time Zones - OpenERP 7

on 10/7/13, 8:39 PM 6,705 views

I'm keeping the current date in a model using a datetime field in which I am indicating default to take the current date as a value.

_defaults = {
   f_inicio' : lambda *a: datetime.now().strftime('%Y-%m-%d %H:%M:%S'),

Assuming that the current date is '07/10/2013 17:24:05 ', in the view is the date '07/10/2013 12:24:05' and rectified in the database and the date is '07/10/2013 17:24:05'; gather that this subtracting five hours. The user can set the time zone 'America/Bogota', Colombia is in the region (GTM - 5:00). But do not understand how to properly show when the user since I get a totally different value that should show. Apparently this taking as 'GTM 0' the GTM Colombia. Taking the approximate date create_date field that should have given me as default is '2013-10-07 22:24:05.384'.

Anyone have any idea what may be happening, really appreciate any help on this issue that is driving me crazy.



| 6 7 8


On 10/8/13, 11:08 AM

OpenERP allways records date & time in UTC in the database (no mater what you do with your timezone settings in the user interface)

The time you see as a user is always referring to this UTC time. This is how the makers of OE want it to be... So far, this wouldn't be a problem but there seems to be a bug report on launchpad and the rendering of this database UTC time to the user's timezone does not always work as it should. This messes up different things. We having trouble with Attendance and timesheets, but I could imagine there are more things that might be affected by this.

If you want to help you can comment on this bug report and to put more importance behind this matter, so this hopefully will be fixed sooner. At present this bug is rated 'Medium' importance, but maybe if more people comment on this ...

here two other postings that deal with this issue. Maybe this helps with your understanding 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 10/7/13, 8:39 PM
Seen: 6705 times
Last updated: 3/16/15, 8:10 AM