Skip to content

Instantly share code, notes, and snippets.

View gawdeparag's full-sized avatar
👨‍💻

Parag Gawde gawdeparag

👨‍💻
View GitHub Profile
@miguelmota
miguelmota / randomDate.js
Last active December 21, 2022 16:27
Random date in JavaScript
function randomDate(start, end) {
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()))
}
console.log(randomDate(new Date(2012, 0, 1), new Date()))