timezone issue

Asked by Cuong

Hi,

In my server environment, timezone is correct (local time). However in openerp-server, time is different (GMT-7).

For example: on my system, date is "Thu Jun 7 15:29:16 ICT 2012", and on openerp-server, date becomes "2012-06-07 08:29:16", it also stores in database as "2012-06-07 08:29:16"

Please help me.
Thank you very much,

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#1

Hi,

What did you set for time zone in your user preference?

OpenERP handle the timezone in a very complex way (it is the fact, It
should have been simplified though)
On OpenERP server, OpenERP will automatically detect the system timezone
setting and convert the time data from user specified time zone(in user
preference) to server time zone and store it. When showing to the user
about time information , OpenERP will do the reverse process.

The problem is that in a lot of case OpenERP may not detect the timezone
correctly ( it is really kind of mission impossible, Windows make the
things even messier) .
In this case, you can manually set the server time zone through command
line option or configuration file, eg

openerp-server --timezone=Asia/Jakarta -s

-s make your timezone configuration store in configuration file, so that
you don't have to type this option every time you start up your server.

Hope it is useful for you.
<http://www.openerp.cn>

*Tony Gu* --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213 Skype: digitalsatori
http://www.openerp.cn
*OpenERP Official Partner in China*

On 2012年06月07日 16:35, Cuong wrote:
> New question #199675 on OpenERP Server:
> https://answers.launchpad.net/openobject-server/+question/199675
>
> Hi,
>
> In my server environment, timezone is correct (local time). However in openerp-server, time is different (GMT-7).
>
> For example: on my system, date is "Thu Jun 7 15:29:16 ICT 2012", and on openerp-server, date becomes "2012-06-07 08:29:16", it also stores in database as "2012-06-07 08:29:16"
>
> Please help me.
> Thank you very much,
>

Revision history for this message
Cuong (bhcuong2008) said :
#2

Hi digitalsatori,

In User Preference, I set timezone is Asia/Ho_Chi_Minh.
I follow your instruction, and have some results.
1. date shows on form is correctly but not correct in database, still my local time - 7.

2. Date shown in raise osv.except_osv() (I use it to show date) is not correct.

It's still a bug...

Thank you very much,

Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#3

Did you set the timezone manually for OpenERP server and restart it( Not
the one in your user preference).

your localtime -7 is UTC time. When OpenERP is not able to detect the
timezone on your system , it will automatically fall back to UTC time.

<http://www.openerp.cn>

*Tony Gu* --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213 Skype: digitalsatori
http://www.openerp.cn
*OpenERP Official Partner in China*

On 2012年06月07日 17:26, Cuong wrote:
> Question #199675 on OpenERP Server changed:
> https://answers.launchpad.net/openobject-server/+question/199675
>
> Status: Answered => Open
>
> Cuong is still having a problem:
> Hi digitalsatori,
>
> In User Preference, I set timezone is Asia/Ho_Chi_Minh.
> I follow your instruction, and have some results.
> 1. date shows on form is correctly but not correct in database, still my local time - 7.
>
> 2. Date shown in raise osv.except_osv() (I use it to show date) is not
> correct.
>
> It's still a bug...
>
> Thank you very much,
>

Revision history for this message
Cuong (bhcuong2008) said :
#4

I set both places, preferences and server conf file. Then restart the server.

It always sets local time - 7, means in linux environment the system date is 15:00:00, but in OpenERP server, it sets automatically to 09:00:00.

I can't figure out what to do correctly.

Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#5

I don't know why the server don't pick your timezone setting. In this
case, I guess you'd better file a bug report.

Best regards,

<http://www.openerp.cn>

*Tony Gu* --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213 Skype: digitalsatori
http://www.openerp.cn
*OpenERP Official Partner in China*

On 2012年06月07日 18:11, Cuong wrote:
> Question #199675 on OpenERP Server changed:
> https://answers.launchpad.net/openobject-server/+question/199675
>
> Cuong posted a new comment:
> I set both places, preferences and server conf file. Then restart the
> server.
>
> It always sets local time - 7, means in linux environment the system
> date is 15:00:00, but in OpenERP server, it sets automatically to
> 09:00:00.
>
> I can't figure out what to do correctly.
>

Revision history for this message
El Hadji Dem (http://www.savoirfairelinux.com) (eh-dem) said :
#6

Hi , I have the same problem with openErp6.1, did you find a solution ???

Thanks

Revision history for this message
Cuong (bhcuong2008) said :
#7

Hi eh.dem,

I still can't resolve my issue.

Revision history for this message
Andres Calle (TRESCLOUD) (andres-calle) said :
#8

Maybe (not sure yet) you need to setup a timezone in openerp-server.conf

# specify reference timezone for the server (e.g. Europe/Brussels")
timezone = False

Revision history for this message
Songpon Phusing (songpon.p-almacom) said :
#9

HI,
Since version 6.1
OpenERP use UTC time to store in database and user's preference will be use to convert from UTC.
In timzezone configuration doesn't change anything.
Don't worry about this issue.
Thanks,
Songpon

Can you help with this problem?

Provide an answer of your own, or ask Cuong for more information if necessary.

To post a message you must log in.