Nguyen Hoang Nguyen
03/06/2020, 7:53 AMfrom prefect.schedules.clocks import CronClock
import pendulum
schedule = Schedule(clocks=[CronClock("40 14 * * *", start_date=pendulum.now("Asia/Ho_Chi_Minh"))])
Alex Goodman
03/06/2020, 1:18 PMprefect.schedules.Schedule(
clocks=[CronClock("17 20 * * *", start_date=pendulum.now("Asia/Ho_Chi_Minh"))]
)
...
[2020-03-06 13:16:30,276] INFO - prefect.Flow: long-sleep | Waiting for next scheduled run
at 2020-03-06T20:17:00+07:00
[2020-03-06 13:17:00,005] INFO - prefect.FlowRunner | Beginning Flow run for 'long-sleep'
Nguyen Hoang Nguyen
03/10/2020, 3:16 AMimport prefect
from prefect import task, Flow
from datetime import timedelta
from prefect.schedules.clocks import CronClock
import pendulum
@task
def say_hello():
print("Hello, world!")
daily_schedule = prefect.schedules.Schedule(clocks=[CronClock("17 20 * * *", start_date=pendulum.now("Asia/Ho_Chi_Minh"))])
with Flow("Hello", daily_schedule) as flow:
say_hello()
flow.run()
it returns this while my execute local time is 10:20 AM. So the clock is still UTC
[2020-03-10 03:19:33,565] INFO - prefect.Flow: Hello | Waiting for next scheduled run at 2020-03-10T20:17:00+07:00
you can see the screenshot below if you want