flask_apscheduler Unable to determine the name of the local timezone

最近在配置flask_apscheduler遇到了问题:

ValueError: Unable to determine the name of the local timezone – you
must explicitly specify the name of the local timezone. Please refrain
from using timezones like EST to prevent problems with daylight saving
time. Instead, use a locale based timezone name (such as
Europe/Helsinki).

解决方法是添加环境变量:

import os
os.environ['TZ']= 'Asia/Shanghai'

你可能感兴趣的:(运维,开发,flask,python)