x
 
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript toString()</h2>
<p>The toString() method converts a date to a string:</p>
<p id="demo"></p>
<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.toString();
</script>
</body>
</html>