DevTools Logo

Random Date Generator

Random Date Generator

Uniform dates in any range — formats, timezones and bulk fixtures

Runs in your browser

Range & format

20 dates · UTC

Uniformly samples instants in a chosen range using rejection sampling, then renders them in your timezone with ISO, US, EU, long or custom token formats. Business-day filtering, unique display values, sorting and epoch columns make the output fixture-ready.

Generated dates

No dates generated

Set a range and press Generate

Dates are sampled uniformly, then rendered in your timezone.

Try an example

Examples

QA date fields

Input
2026-01-01 … 2026-12-31 · 50 values · ISO · sorted ascending
Output
50 timestamps spread across the year

Uniform sampling with a seed makes the fixture reproducible across team members.

European worksheet

Input
Count 20 · custom DD/MM/YYYY hh:mm · Europe/Berlin
Output
07/03/2026 15:05

Instants are sampled in UTC and displayed with the target zone's offset.

Weekday-only fixtures

Input
Date-only · business days · unique · count 30
Output
30 distinct weekday dates

The tool rejects weekends and reports saturation if the range cannot supply enough days.

About this tool

The Random Date Generator samples instants uniformly between a start and end value and renders them in the format and timezone you choose. Sampling uses WebCrypto with rejection: ranges up to 2^32 milliseconds use a single 32-bit word, wider ranges compose two words with a 64-bit BigInt bound, so no value is over-represented at the edges.

Three granularity modes cover different fixture shapes. Date+time samples any millisecond in the range; date-only samples discrete whole UTC days (so each value is midnight UTC); time-only renders just the clock portion of a sampled instant. Business-day mode rejects Saturdays and Sundays in the target timezone and warns when a narrow range cannot supply enough weekdays.

Formatting is local: presets for ISO 8601, US (MM/DD/YYYY), EU (DD.MM.YYYY) and long locale form, plus a custom token language — YYYY, MM, DD, hh, mm, ss and A for AM/PM. Unknown tokens pass through literally. A 12/24-hour toggle affects custom output only; the timezone selector uses the browser's own Intl data.

Uniqueness is enforced against the displayed value, not just the underlying millisecond, so a custom format that drops precision cannot produce visually duplicated rows. Results can be sorted, exported as CSV with an optional epoch column, or copied — all without leaving the tab.

What this tool does not do

  • Date-only mode anchors to UTC midnight rather than local midnight, which keeps sampling discrete and reproducible.
  • Time-only mode does not attach a date, so sorting is by the underlying sampled instant.
  • Custom formats support a small token set (YYYY MM DD hh mm ss A); arbitrary Intl patterns are not parsed.
  • Business-day filtering excludes weekends only — public holidays are not modeled.

How to use this tool

  1. Set the range

    Enter start and end date-times (or plain dates) — the end must be at or after the start.

  2. Choose how values look

    Pick a format preset or custom tokens, a timezone, and date+time/date-only/time-only granularity.

  3. Refine the batch

    Set count, business-day or uniqueness filters, sort order, an optional seed, then press Generate.

  4. Export

    Toggle the epoch-ms column if needed, then Copy or download the CSV.

Use cases

Seeding test databases

Fill date columns with realistic, uniformly distributed values and export a CSV for your seed script.

Classroom exercise sets

Give students a fixed seed and range so everyone gets the same reproducible dataset.

Demo dashboards

Generate sorted weekday-only timestamps to make activity charts look plausible.

Format tokens and presets

FormatExample
ISO 86012026-03-07T14:05:09.000Z (always UTC)
US03/07/2026 in the selected timezone
EU07.03.2026 in the selected timezone
LongMarch 7, 2026 at 2:05:09 PM
CustomDD/MM/YYYY hh:mm:ss A → 07/03/2026 02:05:09 PM
CSVdate column, optionally date,epoch_ms

Unknown custom tokens are passed through; the token list is shown above the input.

Common mistakes

Mistake:Expecting a custom format to change the sampled instant.

Fix:Formatting happens after sampling. The timezone control changes how an instant is displayed, not which instants are drawn.

Mistake:Requesting more unique date-only values than the range contains days.

Fix:Widen the range or turn off uniqueness. The tool reports exactly how many distinct values it could produce.

Mistake:Using the seeded mode for secrecy.

Fix:Seeds produce reproducible fixtures, not secrets. Anyone with the same seed and settings gets the same dates.

Frequently asked questions

Are the dates uniformly distributed?

Yes. The generator draws an integer offset inside the range with rejection sampling: it discards values in the partial final block so every millisecond has equal probability. For ranges wider than 2^32 milliseconds it composes two 32-bit words and applies the same rejection rule with a 64-bit bound. A seed only makes the sequence reproducible; it does not change the distribution.

Can I generate only business days?

Turn on Business days only. Weekends are rejected in the selected timezone, so the result depends on the timezone as well as the range. If the range is short or unique is enabled, the tool may not be able to produce the requested count; it reports how many values it found rather than silently duplicating them. Holidays are not modeled.

How does timezone affect the output?

Instants are sampled in UTC and formatted with the browser's Intl data for the timezone you select. Changing UTC to Europe/Berlin in July shifts displayed clocks by two hours, and Asia/Kolkata by five and a half. Date-only mode is the exception: it samples discrete UTC days, so each value is midnight UTC and the timezone affects only display of that instant.

Can I exclude weekends?

Yes — that is exactly the business-days toggle. If you need finer control such as only Mondays or holiday calendars, generate a larger batch and filter the CSV externally; those calendars are intentionally out of scope for this tool.

How many unique dates can I generate?

It depends on granularity. In date+time mode the number of possible milliseconds in the range is enormous; in date-only mode it is the number of days. Uniqueness is checked against the displayed value, so a custom format that omits the time has the same limit as date-only. If you request more than the range can supply, the tool reports the shortfall with the exact count.

What do the custom format tokens mean?

YYYY is the four-digit year, MM the two-digit month, DD the day, hh the hour, mm the minute, ss the second, and A prints AM or PM when the 12-hour toggle is on. Tokens are replaced from the selected timezone's UTC offset; unrecognized text is left alone, so literals such as `[week]` survive untouched.

References & standards