谢谢分享 :aplauso:
我顺便贴下代码:
odoo/__init__.py这个是用于unix系统
#---------------------------------------------------------- # libc UTC hack #---------------------------------------------------------- # Make sure the OpenERP server runs in UTC. import os os.environ['TZ'] = 'UTC' # Set the timezone import time if hasattr(time, 'tzset'): time.tzset()odoo-bin这部分用于windows系统,因为在windows里通过修改环境变量来使time的时区改变必须在time模块被import前。
__import__('os').environ['TZ'] = 'UTC'