Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
12834 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
and
(https://accounts.openerp.com/forum/Help-1/question/17404)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
Take Users Timezone Đã xử lý
3
thg 7 25
4228
Time & Date Issue Đã xử lý
6
thg 9 19
11550
2
thg 3 16
8034
0
thg 3 15
8315
4
thg 3 23
15060