Jump to content

Recommended Posts

Posted
<SCRIPT LANGUAGE="Javascript">
var days = new Array(8);
days[1] = "Domingo";
days[2] = "Segunda";
days[3] = "Terça";
days[4] = "Quarta";
days[5] = "Quinta";
days[6] = "Sexta";
days[7] = "Sabado";

var months = new Array(13);
months[1] = "Janeriro";
months[2] = "Fevreiro";
months[3] = "Março";
months[4] = "Abril";
months[5] = "Maio";
months[6] = "Junho";
months[7] = "Julho";
months[8] = "Agosto";
months[9] = "Setembro";
months[10] = "Outobro";
months[11] = "Novembro";
months[12] = "Dezembro";

var dateObj = new Date(document.lastModified)
var wday = days[dateObj.getDay() + 1]
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
if (fyear < 2000)
fyear = fyear + 1900
document.write(wday + ", " + lmonth + " " + date + ", " + fyear)
</SCRIPT>

sempre que fizer alterações à página este script vai dizer quando foi. 🙂

Our lives begin to end the day we become silent about things that matter - Martin Luther King

  • 2 years later...
Posted
<SCRIPT LANGUAGE="JavaScript">
var days = new Array(8);
days[1] = "Domingo";
days[2] = "Segunda";
days[3] = "Terça";
days[4] = "Quarta";
days[5] = "Quinta";
days[6] = "Sexta";
days[7] = "Sabado";

var months = new Array(13);
months[1] = "Janeiro";
months[2] = "Fevereiro";
months[3] = "Março";
months[4] = "Abril";
months[5] = "Maio";
months[6] = "Junho";
months[7] = "Julho";
months[8] = "Agosto";
months[9] = "Setembro";
months[10] = "Outobro";
months[11] = "Novembro";
months[12] = "Dezembro";

var dateObj = new Date(document.lastModified)
var wday = days[dateObj.getDay() + 1]
var de = "de"
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
if (fyear < 2000) 
fyear = fyear + 1900
document.write(wday + ", " + date + " " + de + " " + lmonth + " de " + fyear)
</SCRIPT>

Fiz umas pequenas modificações neste codigo para parecer mais portuga, pois a ordem e a contenação das palavras estavam inglesadas lol 🙂

Melhores Cumprimentos,

Ivo Barbosa

  • 1 year later...
Posted

Este código serve para o próprio documento, e está dependente de javascript. Para criares listagens de ficheiros e suas datas de modificação, podes usar uma linguagem server side como o PHP, que vai buscar essa informação ao sistema de ficheiros.

Nick antigo: softclean | Tens um projeto? | Wiki P@P

Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.