1var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
2var today = new Date();
3
4console.log(today.toLocaleDateString("en-US")); // 9/17/2016
5console.log(today.toLocaleDateString("en-US", options)); // Saturday, September 17, 2016
6console.log(today.toLocaleDateString("hi-IN", options));
1<p>The toDateString() method converts a date to a date string:</p>
2
3<p id="demo"></p>
4
5<script>
6var d = new Date();
7document.getElementById("demo").innerHTML = d.toDateString();
8</script>
9//output: Fri Oct 16 2020