<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p id="workingcode"></p>
<script>
const d = new Date("2023-07-17");
document.getElementById("workingcode").innerHTML = d;
</script>
</body>
</html>
Output:
JavaScript Dates
Using new Date()
Mon Jul 17 2023 05:30:00 GMT+0530 (India Standard Time)
Dates function in JavaScript
Expert Asked question July 17, 2023