Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Dates</h2>
<p>toString() returns a date object as a string:</p>
<p id="demo"></p>
<script>
const d = new Date();
let text = d.toString();
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>