Skip to content

Instantly share code, notes, and snippets.

@ex-hota911
Last active October 10, 2018 14:29
Show Gist options
  • Select an option

  • Save ex-hota911/3afb8f972a16c94a5dc416be221257da to your computer and use it in GitHub Desktop.

Select an option

Save ex-hota911/3afb8f972a16c94a5dc416be221257da to your computer and use it in GitHub Desktop.
import pytz
from airflow import models
tz = pytz.timezone('Asia/Tokyo')
def in_jst(execution_date):
"""Returns the execution date in JST."""
return tz.fromutc(execution_date)
def ds_in_jst(execution_date):
"""Returns the ISO format date string of execution date in JST."""
returns in_jst(execution_date).date().isoformat()
with models.DAG(
dag_id="dag",
# Run DAG at 3 am in JST.
schedule_interval="0 18 * * *",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment