Skip to content

Instantly share code, notes, and snippets.

@rumblestrut
Created September 12, 2014 21:01
Show Gist options
  • Select an option

  • Save rumblestrut/efefc7971a48c550db43 to your computer and use it in GitHub Desktop.

Select an option

Save rumblestrut/efefc7971a48c550db43 to your computer and use it in GitHub Desktop.
Current date JavaScript
<html>
<head>
<title>Current Date</title>
<script type="text/javascript">
var d = new Date();
var current_date = d.getDate();
var current_month = d.getMonth() +1;
var current_year = d.getFullYear();
document.write("Today is " + current_month + "-" + current_date + "-" + current_year);
</script>
<style type="text/css">
body { font-family: Arial, Helvetica, sans-serif; }
</style>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment