# Expiration

Represents a date of expiration.

The amount can be specified either as a Date object, timestamp, Duration or string.

- Source: [`core/lib/expiration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/expiration.ts#L7)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const expiration = cdk.Expiration.after(cdk.Duration.minutes(30));
```

## Properties

- `date`: date — Expiration value as a Date object.

## Methods

- `after(t: Duration): Expiration // chainable` (static) — Expire once the specified duration has passed since deployment time.

  **Parameters**

  - `t` — the duration to wait before expiring.

- `atDate(d: date): Expiration // chainable` (static) — Expire at the specified date.

  **Parameters**

  - `d` — date to expire at.

- `atTimestamp(t: number): Expiration // chainable` (static) — Expire at the specified timestamp.

  **Parameters**

  - `t` — timestamp in unix milliseconds.

- `fromString(s: string): Expiration // chainable` (static) — Expire at specified date, represented as a string.

  **Parameters**

  - `s` — the string that represents date to expire at.

- `isAfter(t: Duration): boolean` — Check if Expiration expires after input.

  **Parameters**

  - `t` — the duration to check against.

- `isBefore(t: Duration): boolean` — Check if Expiration expires before input.

  **Parameters**

  - `t` — the duration to check against.

- `toEpoch(): number` — Expiration Value in a formatted Unix Epoch Time in seconds.
