Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate current date using Javascript
<script type="text/javascript"> //Generate current date
var currentDate = new Date();
var month = currentDate.getMonth() + 1;
var day = currentDate.getDate();
var year = currentDate.getFullYear();
document.write(day + "/" + month + "/" + year);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment