Page Load Timestamp
Keep content transparent. This script automatically displays a timestamp footer, telling users exactly when the page content was last updated or generated.
Page Status
Current Load Time:
...
...
Last Modified Header:
...
...
Note: On dynamic PHP pages, these two values are often identical.
Copy the Script
<script>
// Option 1: Show when the file was last saved
var modDate = new Date(document.lastModified);
document.write("Last Updated: " + modDate.toLocaleString());
// Option 2: Show current load time
var loadDate = new Date();
document.write("<br>Page Loaded: " + loadDate.toLocaleString());
</script>
Frequently Asked Questions
It is a built-in JavaScript property that returns the date and time the current document was last saved on the server.
For PHP/dynamic pages, `lastModified` usually reflects the moment the page was generated (current time), not when the source code was changed. For static HTML, it shows the file save time.
Yes. You can pass `document.lastModified` into a `new Date()` object and use methods like `.toLocaleString()` or `.toDateString()` to style it.