Document lastModified Property - Javascript DOM

Javascript examples for DOM:Document lastModified

Description

The lastModified property returns the date and time the current document was last modified.

This property is read-only.

Return Value

A String, representing the date and time the document was last modified

The following code shows how to get the date and time the current document was last modified:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials