dia = new Date(); ano = dia.getYear(); if (ano < 2000) {ano = 1900 + dia.getYear();} mes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro") document.writeln("" + dia.getDate() + " de " + mes[dia.getMonth()] + " de " + ano + "."); function time(){ var hoje = new Date() DiaDoMes = hoje.getDate() EsteMes = hoje.getMonth() if(hoje.getMinutes() < 10){ pad = "0"} else pad = ""; if((hoje.getHours() < 12) && (hoje.getHours() >= 6)){ var cumprimento = "Bom Dia! " } if((hoje.getHours() >= 12) && (hoje.getHours() < 18)){ var cumprimento="Boa Tarde! " } if((hoje.getHours() >= 18) && (hoje.getHours() <= 23)){ var cumprimento="Boa Noite! " } if((hoje.getHours() >= 0) && (hoje.getHours() < 4)){ var cumprimento = "Boa Madrugada! " } if((hoje.getHours() >= 4) && (hoje.getHours() <= 6)){ var cumprimento = "Bom fim de noite! " } return cumprimento } Cumprimento=time() document.write("",Cumprimento,"")