Marco Palmeri
01/21/2021, 8:50 PMZanie
now = pendulum.now("utc")
dates = {
"date": now,
"today": now.strftime("%Y-%m-%d"),
"yesterday": now.add(days=-1).strftime("%Y-%m-%d"),
"tomorrow": now.add(days=1).strftime("%Y-%m-%d"),
"today_nodash": now.strftime("%Y%m%d"),
"yesterday_nodash": now.add(days=-1).strftime("%Y%m%d"),
"tomorrow_nodash": now.add(days=1).strftime("%Y%m%d"),
}
Marco Palmeri
01/21/2021, 8:59 PMJeremiah
date
variable in context is a pendulum object, so you could load it into any time zone. I think you’d do something like this:
prefect.context.date.in_tz('EST')
Marco Palmeri
01/21/2021, 9:02 PMJeremiah
Marco Palmeri
01/21/2021, 9:03 PM