Last active
April 24, 2017 14:12
-
-
Save Lugghawk/02800f5d2e8733395011bfaf982aa5e8 to your computer and use it in GitHub Desktop.
This file contains 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
//From here: http://stackoverflow.com/questions/9035627/elegant-method-to-generate-array-of-random-dates-within-two-dates | |
function randomDate(start, end) { | |
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); | |
} | |
//Create a new date between Jan 1st, 2012 and Now. | |
randomDate(new Date(2012, 0, 1), new Date()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment