Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the date and time this document was last modified.</p>

<p><strong>Note:</strong> In this example, we convert the lastModified property into a Date object.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = new Date(document.lastModified);
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy