Random date generator

Press the button to get a random date, complete with the day of the week.

What it's for

A random date is more often needed by whoever writes software than by whoever plays: filling in a test form, populating a sample table, checking that a field accepts what it should. It's also good for games («what day of the week was that?»), for drawing a date out of many or for a history exercise. Along with the date you always get the day of the week, which is the part nobody could work out in their head.

The dates are all real

The day is picked from the ones that month actually has, so the 31st only comes up in months with thirty-one days and 29 February only in leap years. It's a detail that matters precisely for this page's main use: if you're testing a form, month-end dates and 29 February are the cases that break programs, and it's better that they show up.

The range runs from 1950 to today and a little beyond, the period in which birth dates, contracts and deadlines fall: it's the window most tests need.

The day of the week isn't a detail

It's the part that makes the date useful: knowing a certain date was a Sunday changes the sense of a contract, a deadline or a memory. The working out is done by the browser's calendar, which knows the Gregorian calendar and its leap years (divisible by four, except century years not divisible by four hundred: which is why 1900 wasn't a leap year and 2000 was).

Nearby tools

To find the day of the week of a date you already have, or the distance between two dates, there are Difference between dates and Add days to a date. For random numbers there is Random number generator, and to draw from options you write yourself Pick for me.