Created
July 12, 2021 17:23
-
-
Save HallexCosta/c74db65405e05986e256899f6423badd to your computer and use it in GitHub Desktop.
Generate Random Date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomDate(start: Date, end: Date) { | |
return new Date( | |
start.getTime() + Math.random() * (end.getTime() - start.getTime()) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment