How to change timezone in airflow-worker and docker operator #17131
Unanswered
joufuljohn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys, I am currently using airflow in docker.
I am using docker operator in my dag and want to change the timezone of the docker operator to my local timezone.
I have tried changing the environmental variables through docker-compose.yaml and localizing the timezone in my dag code.
AIRFLOW__CORE__DEFAULT_TIMEZONE: Asia/Shanghai AIRFLOW__WEBSERVER__DEFAULT_UI_TIMEZONE: Asia/Shanghai AIRFLOW__WEBSERVER__BASE_URL: http://${WEB_IP:-localhost}/ TZ: Asia/Shanghai
local_tz = pendulum.timezone("Asia/Shanghai") start_date = datetime(2020, 1, 1, tzinfo=local_tz) default_args = { 'owner': 'airflow', 'description': 'Use of the DockerOperator', 'depend_on_past': False, 'start_date': datetime(2018, 1, 3, tzinfo=local_tz),
I want to know if there is any other way to change the timezone setting.
ThX!!!!
Beta Was this translation helpful? Give feedback.
All reactions