Webmaster

Tips
All Tips ]

Display the date for last update of a page

To display a message indicating the date of the last update for a document, use the following JavaScript:

Add the following script in your HTML document between the <HEAD> and </HEAD> tags:

<SCRIPT>
function Tableau(n) {
this.length=n;
return this; }
function DateModif() {
NomMois=new Tableau(12)
NomMois[1]="january"
NomMois[2]="february"
NomMois[3]="march"
NomMois[4]="april"
NomMois[5]="may"
NomMois[6]="june"
NomMois[7]="july"
NomMois[8]="august"
NomMois[9]="september"
NomMois[10]="october"
NomMois[11]="november"
NomMois[12]="december"
Date=new Date(document.lastModified)
var Mois=NomMois[Date.getMonth()+1]
var Annee=Date.getYear()
return Date.getDate()+" "+Mois+" "+Annee }
</SCRIPT>

Then, in your desired location on the page, between the <BODY> and </BODY> tags, add:

<SCRIPT> document.write(DateModif())</SCRIPT>

This produces the following result:



Discover all Webmaster tips.