I am using OpenERP version 6.1
and OpenERP web client
. The OpenERP
server is installed in my laptop hence both server and the client on the same machine.
The issue I am facing is that it looks like OpenERP
treats my local time as current UTC
time.
My time zone in Windows is set to UTC+5:30 hours (Asia/Colombo)
and the current time is 11:00 AM
. When I see the current time from OpenERP using,
'date_created': lambda *a: datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
It shows me 03/29/2012 16:30:24 instead of correct time 11:00 AM. My observation is that OpenERP get the current time and add 5 hours 30 minutes to current time and shows me. So, OpenERP assumes my current local time as the current UTC time.
I must install the software at clients site but without this fixed, I cannot install.
The OpenERP v6.1 Release Notes state that now the server and database work exclusively with UTC dates, ignoring the OS timezone settings.
The timezone conversion is made dynamically by the client:
There is one golden rule for datetime fields in 6.1 addons code:
"ALWAYS work in UTC - compute in UTC - save in UTC
"
The UTC values will be properly converted to local time when the result is
diplayed in a client-side form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With