<@ULVA73B9P> Where is there a list of valid timezo...
# ask-marvin
j
@Marvin Where is there a list of valid timezone values when setting values on schedules with
prefect deploy
or in a prefect.yaml file?
m
thought for 78.4 seconds
The short answer: Prefect expects IANA timezone names. Examples: -
UTC
-
America/New_York
-
Europe/London
-
Asia/Tokyo
There isn’t a Prefect-specific custom list; the source of truth is the timezone database exposed by Python’s
zoneinfo
, which is based on the IANA tz database. Where to look - Prefect schedule docs: Schedules - IANA timezone database: IANA Time Zone Database - Python
zoneinfo
docs: zoneinfo What to use in
prefect.yaml
/
prefect deploy
Use an IANA name, for example:
Copy code
yaml
deployments:
  - name: my-deployment
    entrypoint: flow.py:my_flow
    schedules:
      - cron: "0 9 * * *"
        timezone: "America/New_York"
If you use an invalid value, Prefect validates it and will raise an error like:
Invalid timezone ... specify in IANA tzdata format, for example, America/New_York
Practical note Avoid abbreviations like: -
EST
-
PST
-
CST
Those are ambiguous or not accepted consistently. Prefer full IANA names like
America/Los_Angeles
. If you want, I can also show you how to list all valid timezone values from Python on your machine.
n
hi @Jason Wiener - curious where you edit your
prefect.yaml
? its possible that we can autocomplete valid values, depending on your editor
j
PyCharm or vi, depending on the context. This was me trying to figure out what was expected since the UI uses "America / New York", which isn't a value in tzdata (though maybe an attribute somewhere in there?)