i using <filters.at>_time() to setting schedule f...
# ask-community
a
i using filters.at_time() to setting schedule for Flow. But i can't defind the schedule at time with timezone. How to do that? tks all
a
Can you explain without code what schedule do you want to attach, e.g. every day at 9 AM in your time zone? it could be that you can accomplish the same using just IntervalSchedule But if you want to use at_time filter in your time zone, here is an example
Copy code
from datetime import timedelta
import pendulum
from prefect.schedules import Schedule
from prefect.schedules.clocks import IntervalClock
from prefect.schedules.filters import at_time

clock = IntervalClock(
    start_date=pendulum.datetime(2022, 2, 1, 9, 0, tz="America/New_York"),
    interval=timedelta(days=1),
)
schedule = Schedule(clocks=[clock], filters=[at_time(pendulum.time(9))])
for sched in schedule.next(10):
    print(sched)
a
If i want to set multiple start time with time zone for schedule in day. how to do that ?
a
You can attach multiple clocks to your schedule. Can you explain what is the end outcome you try to achieve? Run the flow at X exact dates? Or run it at X different intervals (hourly, daily, weekly)?