How are random times of day generated?
This generator builds each time from three independent random numbers: an hour from 0 to 23, a minute from 0 to 59 and a second from 0 to 59. Because each part is uniform, every one of the 86,400 seconds in a day is equally likely. Results are 24-hour, zero-padded HH:MM:SS strings, one per line, up to 50 per click.
There is no date, no time zone and no millisecond part. It answers one narrow question, "give me a time of day", and leaves context to you.
Getting a list of times
- Set the Times slider to how many you need (1 to 50; the default is 1).
- Click Generate.
- Click Copy and paste the list wherever you need it.
A run of three produced:
21:22:43
21:33:51
23:26:03
Each click gives a new, unrelated set. Two times in a batch can repeat, though with 86,400 possibilities that's rare in a list of 50.
Reading 24-hour values
The format follows the partial-time rule in RFC 3339, which is the internet profile of ISO 8601. A few values worth recognising:
| Output | 12-hour reading | Notes |
|---|---|---|
| 00:00:00 | 12:00:00 AM | Start of the day; can be generated |
| 06:05:09 | 6:05:09 AM | Every part keeps its leading zero |
| 12:00:00 | 12:00:00 PM | Noon |
| 21:22:43 | 9:22:43 PM | Subtract 12 for afternoon and evening |
| 23:59:59 | 11:59:59 PM | Latest possible value |
| 24:00:00 | (end of day) | Never produced |
| 23:59:60 | (leap second) | Allowed by RFC 3339, never produced |
Zero padding has a nice side effect: alphabetical order equals chronological order. Paste a batch into the text sorter and an A-Z sort gives you a timeline.
Times inside a window
The tool has no minimum or maximum, which matters if you want, say, plausible office-hours appointments. Two ways to get there:
- Filter. A window from 09:00:00 to 16:59:59 covers 8 of 24 hours, so about one random time in three lands inside it. Generate 50 and keep the ones that fit.
- Offset. Pick a random number of seconds between 0 and the window length, then add it to the start. An 8-hour window is 28,800 seconds, so draw a number from 0 to 28,799 with the random integer generator. If you get 12,345, that is 3 hours (10,800 s), 25 minutes (1,500 s) and 45 seconds, so the time is 09:00:00 plus 03:25:45, or 12:25:45.
The offset method gives an even spread across the window and never wastes a draw.
Time zones and daylight saving
A bare time like 02:30:00 means nothing until you attach a date and a zone, and some combinations don't exist. In zones that spring forward at 02:00, clocks jump straight to 03:00 on that day, so 02:30 local time never happens; on the autumn change, 01:30 can happen twice. If you're generating test data for a scheduling system, that's worth exploiting on purpose: feed it times that fall in the gap and see what breaks. The time zone converter helps you check what a time means in another zone.
To build full timestamps, pair these values with dates from the random date generator and join them with a T, as in 2027-03-29T21:22:43, which is the combined date-time form RFC 3339 uses. Add Z or an offset like +02:00 when the zone matters.
Randomness and privacy
Each component comes from crypto.getRandomValues(), the browser's cryptographically secure generator, mapped to its range by rejection sampling so no hour or minute is favoured. That's more than a time picker strictly needs, but it means a classroom "what time is it on this clock?" quiz or a randomised alarm schedule isn't predictable. The page doesn't contact a server at any point; the values exist only in your browser until you copy them.
Last updated