Datetime and Time Zones - OpenERP 7


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:'%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.

1 Answer
Best Answer

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://