On UNIX, the timezone modules conversions can be reset by using `time.tzset()`. On windows this is not available and the timezone (TZ) environment variable must be set before the first import of time module. If not, all datetime gotten in python without specifying UTC (such as datetime.datetime.now) could be wrong. This was fixed with4a77c6a0in 2013, but has come back since389c2ba97bimported pkg_resources (which do a `time` module import) before that. closes #14926 opw-693764
10 lines
240 B
Python
Executable File
10 lines
240 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
# set server timezone in UTC before time module imported
|
|
__import__('os').environ['TZ'] = 'UTC'
|
|
__import__('pkg_resources').declare_namespace('odoo.addons')
|
|
import odoo
|
|
|
|
if __name__ == "__main__":
|
|
odoo.cli.main()
|