Example of interval schedule with timezone in :thr...
# pacc-jan-28-29-2025
b
Example of interval schedule with timezone in ๐Ÿงต ๐Ÿ•
๐Ÿฆœ 1
Copy code
from datetime import datetime, timedelta
from prefect import flow
from prefect.client.schemas.schedules import IntervalSchedule


@flow(log_prints=True)
def my_flow(name: str = "world"):
    print(f"Hello, {name}!")


if __name__ == "__main__":
    my_flow.deploy(
        name="my-deployment",
        work_pool_name="my-work-pool",
        image="my-docker-image:dev",
        push=False,
        # Run every 10 minutes starting from January 1, 2023
        # at 00:00 Central Time
        schedules=[
            IntervalSchedule(
                interval=timedelta(minutes=10),
                anchor_date=datetime(2023, 1, 1, 0, 0),
                timezone="America/Chicago"
            )
        ]
    )
๐Ÿ™ 1
There's a few more examples here as well.