Random Date / Time
Pick a random date within a range, or a random time of day.
Overview
The Random Date / Time tool picks a uniformly-distributed datetime within a configurable window, useful for seeding event logs, generating "random workout" or "random journal" prompts and stress-testing date-handling code with values you would never type by hand. You can constrain it to dates only, times only or a full ISO 8601 timestamp.
The tool is aimed at QA engineers building edge-case datetime fixtures, developers testing timezone-aware code, content creators picking a random "on this day" hook and backend developers seeding analytic test data. Long-tail searches like "random date between two dates", "uniform random timestamp generator" and "random time of day for cron tests" all resolve here.
How it works
The tool converts the start and end of the requested window to Unix milliseconds, computes the range in milliseconds and draws a uniformly random offset using the OS cryptographic random source. Adding the offset to the start gives the random timestamp, which is then formatted back into the requested representation: ISO 8601 with optional timezone, RFC 1123, Unix seconds/milliseconds or human-readable.
For time-only mode, the tool samples uniformly across the 24-hour day and snaps to the requested precision (second, minute or hour). For date-only mode, it samples uniformly across whole days and emits a calendar date. All sampling uses rejection on the random integer source to avoid modulo bias, which matters when the requested range is not a power of two.
Examples
Between 2020-01-01 and 2024-12-31 → 2022-07-14T03:21:55Z
Random time of day → 17:43:02
Date only, last year → 2025-09-04
Unix seconds in the past week → 1747142345
FAQ
Is the sample uniform on the timestamp axis?
Yes. The tool samples milliseconds uniformly, so each instant in the window is equally likely.
Does it respect timezones?
Yes. Pick an input timezone and the window is interpreted in that zone; the output can be formatted in any zone via the offset selector.
Can I exclude weekends or business hours?
Toggle the business-hours filter to restrict the sample to weekdays 09:00-17:00 in the chosen timezone. Other filters can repeat-sample until a match.
What about leap seconds?
The tool uses Unix time, which ignores leap seconds. For most application code this is the right call; specialised astronomy use needs TAI.
Can I bulk-generate timestamps for a test dataset?
Yes. Set the count and the tool emits N timestamps in the requested format, one per line, ready to paste into a CSV.