<html>
<body>
<h2>JSON.stringify() converts date objects into strings.</h2>
<p id="demo"></p>
<script>
const obj = { name: "John", today: new Date(), city: "New York" };
const myJSON = JSON.stringify(obj);
document.getElementById("demo").innerHTML = myJSON;
</script>
</body>
<!-- /js/tryit.asp?filename=tryjson_stringify_date Thu, 06 Feb 2025 18:15:27 GMT -->
</html>