# CronOptionsWithTimezone

Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of
a field implies '*' or '?', whichever one is appropriate.

Extends: CronOptionsWithTimezone
Extends: CronOptions

- Source: [`aws-scheduler/lib/schedule-expression.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-scheduler/lib/schedule-expression.ts#L82)
- Type last changed: v2.186.0 · 27 Mar 2025

## Example

```ts
declare const target: targets.LambdaInvoke;

const rateBasedSchedule = new Schedule(this, 'Schedule', {
    schedule: ScheduleExpression.rate(Duration.minutes(10)),
    target,
    description: 'This is a test rate-based schedule',
});

const cronBasedSchedule = new Schedule(this, 'Schedule', {
    schedule: ScheduleExpression.cron({
        minute: '0',
        hour: '23',
        day: '20',
        month: '11',
        timeZone: TimeZone.AMERICA_NEW_YORK,
    }),
    target,
    description: 'This is a test cron-based schedule that will run at 11:00 PM, on day 20 of the month, only in November in New York timezone',
});
```

## Properties

- `day`: string — The day of the month to run this rule at.

  **Default:** Every day of the month

- `hour`: string — The hour to run this rule at.

  **Default:** Every hour

- `minute`: string — The minute to run this rule at.

  **Default:** Every minute

- `month`: string — The month to run this rule at.

  **Default:** Every month

- `timeZone`: [TimeZone](/cdk/api/v2/docs/aws-cdk-lib.TimeZone.html) = TimeZone.ETC_UTC — The timezone to run the schedule in.

- `weekDay`: string — The day of the week to run this rule at.

  **Default:** Any day of the week

- `year`: string — The year to run this rule at.

  **Default:** Every year
