Document lastModified Property - Convert the lastModified property into a Date object: - Javascript DOM

Javascript examples for DOM:Document lastModified

Description

Document lastModified Property - Convert the lastModified property into a Date object:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {// ww  w  . j a  v  a2 s  . c  o  m
    var x = new Date(document.lastModified);
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials