Use the toDateString() method to convert the date to a more readable format. - Javascript Date

Javascript examples for Date:Quiz

Description

Use the toDateString() method to convert the date to a more readable format.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
document.getElementById("demo").innerHTML = new Date().toDateString();
</script>//from   ww w . j a va2 s . com

</body>
</html>

Related Tutorials