Javascript - Last modification made on a web page

March 2017

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);



Published by jak58.
This document, titled "Javascript - Last modification made on a web page," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (