Anytime generator

Generates a random date that can be either in the past or in the future.

date.anytime

Generator settings

Generate data to see results here.

Parameters & Example

Generates a random date that can be either in the past or in the future.

date.anytime(options?: { refDate? })
options
The optional options object.
options.refDate
The date to use as reference point for the newly generated date. Defaults to the configured reference date.

Example

"2026-05-03T15:48:15.646Z"

Use synthetic data in a test environment.

Related generators

Explore scenarios