🎲

Random Date Time Generator

Generate random timestamps inside a date range, aligned to minute, hour or day, optionally unique and sorted, each with its Unix seconds and a CSV export for test data or draw schedules.
Date 📂 Other 👤 ToolWorld 🏷️ v1.1.3 ⚙️ clipboard
Same seed and range reproduce the same set

How to Use

Overview

When building test data the expensive part is not the code, it is inventing timestamps that look plausible: orders that fall inside a campaign window, attendance records scattered across working days, draw times that must not repeat yet should not look suspiciously regular. This generator produces a chosen number of random points inside a start and end range, with optional alignment to a whole minute, hour or day so nothing lands on an odd 03:17:42 second. Uniqueness can be enforced to keep a draw free of duplicates, results can be sorted for direct pasting into a time ordered sheet, and every row carries the Unix seconds value so the batch can be loaded into a database or a test script through CSV.

Features

  • Batch generation inside a range, up to 200 points per run, bounded by two datetime fields
  • Alignment to minute, hour or day so generated points never carry stray seconds or milliseconds
  • A uniqueness switch that prevents the same instant from appearing twice, essential for draws and dispatch
  • Ordering by random or ascending, where ascending output drops straight into a chronological sheet
  • Each row carries both the readable time and the Unix seconds value for database columns
  • Copy the list as plain text, or export a three column CSV of index, time and Unix seconds

How to use

  1. Set the start and end datetimes; an end earlier than the start is rejected immediately
  2. Enter how many points you want, capped at 200 per run
  3. Choose alignment: exact seconds, whole minutes, whole hours or whole days
  4. Decide on uniqueness and ordering; draws should always have uniqueness on
  5. Press generate, then copy the list or export CSV into the test database

Notes

  • Uniqueness is best effort: in a narrow range close to the number of available points the generator stops after its attempt budget, so you may receive fewer rows than requested
  • Alignment rounds to whole units inside the range, and day alignment lands at midnight, so choose hour alignment when you need times spread across a day
  • Values come from the browser pseudo random generator, which suits fixtures and demos but not lotteries or any draw that needs fairness guarantees
  • Times are read and shown in the local timezone, so a distributed team sees results offset by several hours
  • A range spanning a daylight saving change contains a repeated or missing hour locally; use UTC records when a strictly continuous axis matters
  • The exported CSV carries Unix seconds, so take care not to mix second and millisecond columns on import
  • Generated values are not seeded, which means two runs can never be reproduced exactly for a regression fixture
  • Values are drawn from the browser crypto source when available and fall back to Math.random, both mapped into the chosen span; alignment snaps each result down to the minute, hour or day grid so generated rows match database columns with that precision.
  • Uniqueness is enforced by rejection sampling against the values already produced, so asking for more points than the grid holds returns fewer rows instead of duplicates.
  • A three hour window holds only 180 whole minute steps, so requesting 200 unique minute stamps there cannot be satisfied and the tool says so rather than quietly repeating values.

Related

⏫︎
💬