Skip to main content

Cron

Cron-based automation schedule for use with Trigger.

Attributes

AttributeTypeDescription
expressionstrCron expression string (e.g., "0 * * * *").
timezoneTimezone = UTCTimezone for the cron schedule (default "UTC"). One of the standard timezone values (e.g., "US/Eastern", "Europe/London"). Note that DST transitions may cause skipped or duplicated runs.

Constructor

Signature

def Cron(
expression: str,
timezone: Timezone = "UTC"
)

Parameters

NameTypeDescription
expressionstrCron expression string (e.g., "0 * * * *").
timezoneTimezone = "UTC"Timezone for the cron schedule (default "UTC"). One of the
    standard timezone values (e.g., `"US/Eastern"`, `"Europe/London"`).
Note that DST transitions may cause skipped or duplicated runs. |

Methods


timezone_expression()

@classmethod
def timezone_expression() - > str

Constructs and returns the cron expression prefixed with the timezone setting. This formatted string is suitable for use in systems that support the CRON_TZ environment variable.

Returns

TypeDescription
strThe cron expression string including the timezone prefix (e.g., "CRON_TZ=UTC 0 * * * *").