I had recently upgraded airflow version from airflow 1.8 to apache-airflow 1.9, the upgrade was successful and I have scaled the environment using Celery Executor, everything seemed to be working fine but the dag and tasks start dates, execution dates etc all are appearing in UTC timezone and the scheduled dags are running in UTC, earlier before the upgrade they used to run in Local timezone which is pdt.
Any ideas on how to make pdt as the default timezone in airflow?
I have tried using default_timezone
in the airflow.cfg
to default_timezone = pdt
but even after restarting all the services it schedules the dags and tasks in UTC. Looking forward to your help on fixing the default timezone to pdt.
Airflow running in the local timezone prior to version 1.9.0 was unintended and just a side effect of Airflow code using datetime.now()
and datetime.today()
instead of datetime.utcnow()
. This was rectified in 1.9.0 under AIRFLOW-289, making things timezone independent (always UTC) as you have observed.
Official support for Airflow to be timezone aware is merged into the master branch. This work was completed as part of AIRFLOW-288 and is not available in the latest stable version (1.9.0). You can probably expect it in the next major release.
Once you have that change, Matt's answer should get you what you're looking for.
According to these docs, the default_timezone
accepts an IANA TZ Database time zone identifier. They are listed here.
If you want US Pacific Time, you should set default_timezone=America/Los_Angeles
.