Random date generator
Dates in a range you set, in the format your system expects โ random for realistic spread, or sequential when you need a clean time series.
Range, format and order
The Date field takes four options, and the last one is the interesting one:
- from and to โ the inclusive bounds of the range.
- format โ
yyyy-MM-dd,MM/dd/yyyy,dd/MM/yyyyordd.MM.yyyy. - order โ
randomscatters dates across the range;sequentialwalks evenly from from to to across however many rows you asked for.
Sequential order is what you want for anything that gets plotted or aggregated. A random draw over two years produces a lumpy series with gaps and clusters, which makes a chart look broken; sequential gives you one row per interval and a clean line. Random is right for things like signup dates, where clustering is realistic.
The other time fields
date 2024-11-02 (Date, yyyy-MM-dd) time 14:07:52 (Time, seconds optional) datetime_iso 2024-11-02T14:07:52Z (Datetime ISO 8601) unix_timestamp 1730556472 (Unix Timestamp) day_of_week Saturday month November timezone Europe/Istanbul
Datetime (ISO 8601) is the one to reach for by default in API fixtures โ it is unambiguous, sorts lexicographically and every JSON client parses it. Unix Timestamp gives you an integer column for systems that store epoch seconds. Birthdate lives with the person fields and is configured by age range rather than date range, which is usually what you actually mean.
Dates that break things
Date handling is where quiet bugs live, and a generated range will not find them on its own. Pick your from and to deliberately so the range crosses the boundaries that matter:
- A leap day. Any range spanning 29 February will eventually produce one. If your range is a single non-leap year, you have not tested it.
- A daylight-saving transition. The hour that does not exist in spring and the hour that happens twice in autumn. Combine a Date field spanning late March or late October with a Time field.
- Year boundaries. Week-numbering and fiscal-year logic go wrong around 31 December far more often than anywhere else.
- Month ends. A range covering 28, 29, 30 and 31-day months finds "add one month" bugs.
- Future dates. Set to past today deliberately if you want to test a validator that should reject them โ otherwise the default range ends today and you never exercise that path.
Two dates that have to agree
A common need is created_at and updated_at, where the second must never precede the first. Independent date fields will violate that in roughly half the rows. Generate the first date normally, then use a Formula field for the second so it is derived from the first rather than drawn separately โ the same approach applies to start and end dates, order and shipping dates, and subscription periods. The Formula reference shows the syntax.
Format follows destination
Generate the format your target actually stores. For a Postgres date column or a MySQL DATE, use yyyy-MM-dd โ the ISO form is the only one those parse unambiguously. dd/MM/yyyy and MM/dd/yyyy are display formats, and loading them into a database means relying on locale settings that differ between your machine and CI. They are worth generating for exactly one purpose: testing that your import layer handles ambiguous dates, where 03/04/2024 is either March or April depending on who is reading.
The same trap exists in spreadsheets, where Excel reinterprets date strings on import according to regional settings โ covered in the Excel guide.
Common questions
How do I generate an evenly spaced time series?
Set the Date field's order option to sequential. The generator walks evenly from the start of the range to the end across your requested row count, which is what charts and aggregations need. Random order produces realistic but lumpy data.
Which date formats are available?
yyyy-MM-dd, MM/dd/yyyy, dd/MM/yyyy and dd.MM.yyyy for the Date field. For timestamps, use the separate Datetime (ISO 8601) or Unix Timestamp fields.
How do I make sure updated_at comes after created_at?
Derive it. Two independent date fields will produce impossible pairs in about half the rows; a Formula field that computes the second date from the first will not.
Can I generate dates in the future?
Yes. Set the "to" bound past today. The default range ends at the current date, so future-date validation paths go untested unless you extend it deliberately.
Do the dates include a time zone?
The Datetime (ISO 8601) field emits UTC with a Z suffix. The Date and Time fields are plain local values with no zone, and the Timezone field gives you IANA zone names as a separate column.
Related generators
- UUID generator โ identifiers for the same rows.
- Sales sample data โ a time series with revenue attached.
- Sample JSON data โ ISO timestamps in API fixtures.
- Date & time field reference โ every time field and its options.