Create a Date object to display the current date and time. - Javascript Date

Javascript examples for Date:Quiz

Description

Create a Date object to display the current date and time.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = new Date();
</script>//from   w w  w . ja  va2s.c o  m

</body>
</html>

Related Tutorials