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