Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generate random date in javascript

function randomDate(start, end) {
    return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
}

randomDate(new Date(2012, 0, 1), new Date())
 
PREVIOUS NEXT
Tagged: #generate #random #date #javascript
ADD COMMENT
Topic
Name
4+8 =