Skip to content

Instantly share code, notes, and snippets.

@dipakcg
Created April 2, 2014 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dipakcg/9941663 to your computer and use it in GitHub Desktop.
Save dipakcg/9941663 to your computer and use it in GitHub Desktop.
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);
//-->
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment