|
Data de última atualização |
|
|
Esse javascript exibe a data em que a página foi atualizada pela última vez. Basta copiar e colocar o código no html do seu site.
<script language="JavaScript"> //<!-- function getLongDateString() { //method defined on class Date. //Returns a date string of the form: Day DD Month,YYYY monthNames = new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"); dayNames = new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"); dayOfWeek = this.getDay(); day = dayNames[dayOfWeek]; dateOfMonth = this.getDate(); monthNo = this.getMonth(); month = monthNames[monthNo]; year = this.getYear(); if (year < 2000) year = year + 1900; dateStr = day+" "+dateOfMonth+" "+month+", "+year; return dateStr; } //register the method in the class Date Date.prototype.getLongDateString=getLongDateString;
function DocDate() { //return the document modification date (excl.time) //as a string DateTimeStr = document.lastModified; secOffset = Date.parse(DateTimeStr); if (secOffset == 0 || secOffset == null) //Opera3.2 dateStr = "Unknown"; else { aDate = new Date();
aDate.setTime(secOffset); //use method defined above datestr = aDate.getLongDateString(); } return dateStr; } // --></script>
<script language="JavaScript"> //<!-- document.write("<center> Atualizado em: "); document.writeln(DocDate(),"</center>"); // --> </script>
|
|