# DateIntervalUnit

Date interval unit for partition projection.

- Source: [`lib/partition-projection.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-glue-alpha/lib/partition-projection.ts#L38)
- Type last changed: v2.270.0-alpha.0 · 18 Sep 2026

## Example

```ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
  database: myDatabase,
  columns: [{
    name: 'data',
    type: glue.Schema.STRING,
  }],
  partitionKeys: [{
    name: 'date',
    type: glue.Schema.STRING,
  }],
  dataFormat: glue.DataFormat.JSON,
  partitionProjection: {
    date: glue.PartitionProjectionConfiguration.date({
      min: '2020-01-01',
      max: '2023-12-31',
      format: 'yyyy-MM-dd',
      // `step` bundles interval + unit (supply both or neither). Optional at day
      // precision or coarser; required when the format is sub-day (e.g. hours).
      step: { interval: 1, intervalUnit: glue.DateIntervalUnit.DAYS },
    }),
  },
});
```

## Members

| Member | Description |
| --- | --- |
| `YEARS` | Year interval. |
| `MONTHS` | Month interval. |
| `WEEKS` | Week interval. |
| `DAYS` | Day interval (default). |
| `HOURS` | Hour interval. |
| `MINUTES` | Minute interval. |
| `SECONDS` | Second interval. |

## Referenced by

- [`DateProjectionStep`](/v2/docs/@aws-cdk_aws-glue-alpha.DateProjectionStep).intervalUnit
