Hi all, having some issues with scheduling. We're ...
# ask-community
e
Hi all, having some issues with scheduling. We're using the python SDK to define our schedules and deployments like this
Copy code
from prefect.client.schemas import schedules
from prefect.client.schemas.schedules import DateTimeTZ

pst = "America/Los_Angeles"

daily_midnight_offset_30 = schedules.IntervalSchedule(
    anchor_date=DateTimeTZ(year=2020, month=1, day=1, hour=0, minute=30), timezone=pst, interval=timedelta(hours=24)
)
But the schedule runs at 17:30 Pacific (00:30 UTC). Do python schedules not respect the time zone?
1
👀 1
Our deployment build is like this
Copy code
Deployment.build_from_flow(  # type: ignore
        name=name,
        flow=fn,
        schedule=daily_midnight_offset_30,
        work_pool_name="xx",
        work_queue_name="default",
        version=version,
        infrastructure=<infra block>,
        parameters={},
        tags=[],
        is_schedule_active=True,
        apply=True,
    )
j
hey, if you pass
Copy code
schedule = IntervalSchedule(
    anchor_date=datetime(year=2020, month=1, day=1, hour=0, minute=30, tz="America/Los_Angeles")
I think it will give what you want
otherwise it's converting from UTC to your timezone, which is why you're seeing
17:30 Pacific
e
Ah I see, I thought the tz-agnostic anchor date would get converted. Thanks!