Javascript - Last modification made on a web page

December 2016

Monitoring changes made your website:
Using JavaScript, it is possible to display the last modification made on a the web page through the lastmodified property of the object document:

<SCRIPT language="javascript">
var lastModif=document.lastModified;
var dateModif = new Date(lastModif);
var day = dateModif.getDate();
var month=dateModif.getMonth();
var year=dateModif.getYear();
var hours=dateModif.getHours();
var minutes=dateModif.getMinutes();

document.write("la modification made on the ");
document.write(day+"/"+"month"+"/"+year+" at "+hours+":"+minutes);


Related :

This document entitled « Javascript - Last modification made on a web page » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.