Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate a random SQL time from a given range. For generating lots of fake data.
FROM_UNIXTIME(RAND() * (
UNIX_TIMESTAMP('2010-12-30 15:00:00') -
UNIX_TIMESTAMP('2010-10-25 12:00:00')) +
UNIX_TIMESTAMP('2010-10-25 12:00:00')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.