Reputation: 45
Anyone know how to show same data in a datetime field in openerp 6.1 and postgresql?
When I create data at 7:00 (My timezone is +8:00) the view will show me that the data is 7/8/2015 7:00:00
but when I checked the database it became 6/8/2015 22:00:00
Even when I use
date : fields.date.context_today,
Any idea so the view and database datetime data will show the same result?
Upvotes: 1
Views: 989
Reputation: 2324
Times are saved in UTC so that Odoo/OpenERP can support multiple Timezone within a single database. As such all the code related to datetime (at server's level and web UI level) has been build with that assumption in mind. If you need to get the value in different timezone from the database, I believe it is for easier to calculate it from the field's value rather than getting Odoo/OpenERP to manage (storing is just only part of it) the time value in non-UTC timezone.
Upvotes: 1