Como Atualizar Data Atomaticamente
#1 jesuel
Posted 03/09/2003, 08:10
#2
Posted 03/09/2003, 08:29
Tem esse código javascript que coloca a data por extenso na página atualizando-a.
<script language="JavaScript"> hoje = new Date() dia = hoje.getDate() dias = hoje.getDay() mes = hoje.getMonth() ano = hoje.getYear() if (dia < 10) dia = "0" + dia if (ano < 2000) ano = "19" + ano function CriaArray (n) { this.length = n } NomeDia = new CriaArray(7) NomeDia[0] = "Domingo" NomeDia[1] = "Segunda-feira" NomeDia[2] = "Terça-feira" NomeDia[3] = "Quarta-feira" NomeDia[4] = "Quinta-feira" NomeDia[5] = "Sexta-feira" NomeDia[6] = "Sábado" NomeMes = new CriaArray(12) NomeMes[0] = "Janeiro" NomeMes[1] = "Fevereiro" NomeMes[2] = "Março" NomeMes[3] = "Abril" NomeMes[4] = "Maio" NomeMes[5] = "Junho" NomeMes[6] = "Julho" NomeMes[7] = "Agosto" NomeMes[8] = "Setembro" NomeMes[9] = "Outubro" NomeMes[10] = "Novembro" NomeMes[11] = "Dezembro" document.write (NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano) </script>
Experimente colocá-lo dentro do <body> onde quiser deixar a data.
Até mais.
WebDesigner e Produtora Multimídia
ecbert@ig.com.br
Por que cometer erros antigos se há tantos erros novos a escolher?
#3
Posted 08/09/2003, 20:55
#4
Posted 03/10/2008, 14:16
tentei colocar na minha página e quando vou ver esta assim
Sexta-feira, 3 de Outubro de 20108
não consigo tirar esse "1" entre o "20" e "08"
alguem sabe o pq?
obs.: no Explorer funciona certo, no Mozilla ele da esse erro !
Edição feita por: John Frusciante, 03/10/2008, 14:23.
#5
Posted 03/10/2008, 14:58
#6
Posted 03/10/2008, 15:07
[codebox]<font face="Arial, Helvetica, sans-serif" size="2"><script language="javaScript">
<!--
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
if(myday == 0)
day = " Domingo, "
else if(myday == 1)
day = " Segunda-Feira, "
else if(myday == 2)
day = " Terça-Feira, "
else if(myday == 3)
day = " Quarta-Feira, "
else if(myday == 4)
day = " Quinta-Feira, "
else if(myday == 5)
day = " Sexta-Feira, "
else if(myday == 6)
day = " Sábado, "
if(mymonth == 0)
month = "Janeiro "
else if(mymonth ==1)
month = "Fevereiro "
else if(mymonth ==2)
month = "Março "
else if(mymonth ==3)
month = "Abril "
else if(mymonth ==4)
month = "Maio "
else if(mymonth ==5)
month = "Junho "
else if(mymonth ==6)
month = "Julho "
else if(mymonth ==7)
month = "Agosto "
else if(mymonth ==8)
month = "Setembro "
else if(mymonth ==9)
month = "Outubro "
else if(mymonth ==10)
month = "Novembro "
else if(mymonth ==11)
month = "Dezembro "
document.write("<font face=arial, size=1>"+ day);
document.write(myweekday+" de "+month+ "</font>");
// -->
</script>[/codebox]
se vc souber como faz ta aí o cód, serve no FF e no IE, mas não sei por o ano :S
de certo essa deve ser a questão do JS não funfar no FF, essa parte de ANO que ta pegando
deve ter um jeito de fazer funcionar mas não tenho idéia :\
Edição feita por: John Frusciante, 03/10/2008, 15:08.
#7
Posted 03/10/2008, 21:58
ano = hoje.getYear()
#8
Posted 07/10/2008, 10:51
obrigado !!!
#9
Posted 07/10/2008, 13:29
#10
Posted 07/10/2008, 14:00
<meta http-equiv="refresh" content="5;URL=http://www.site.com.br/" />
Edição feita por: Firehalk, 07/10/2008, 14:00.
// Links úteis: Busca || Regras
// Não respondo dúvidas via mensagem privada. Use o fórum para buscar ou perguntar.
#11
Posted 17/09/2017, 12:15
Cialis Brand online pharmacy Order Generic Propecia 1mg
Acheter Lioresal Ligne Pedidos De Viagra
Amoxil Chats Melange <a href=http://cialtobuy.com>cialis online</a> Cialis Online Vendita
#12
Posted 03/10/2017, 18:04
Vente Cialis Authentique Propecia Proscar Benign Prostatic Hyperplasia Keflex Is Used For viagra online prescription Cialis Achat Avis Amoxil Package Insert Propecia Shedding Of Day
Clomid Online online pharmacy Viagra Comentarios Venta Cialis Internet Synthroid For Sale Gnc
#13
Posted 03/10/2017, 22:24
Isotretinoin Sotret In Germany Over Night viagra Zithromax For Strep Tadalis Sx En Ligne
Effet Du Cialis Generique Cialis Durata D'Azione Canadian Pharmacy Cialis 5mg viagra online pharmacy Prescription Free Cialis Effets Cialis Generic Commander Viagra Ligne
#14
Posted 12/10/2017, 20:47
Que Es Mejor Viagra Levitra O Cialis buy viagra online Pages Jaunes Par Cytotec Below Skin Swelling Amoxicillin Allergy Treatment Levitra 20 Mg Best Price
Quick Ejaculation Viagra Zu Teuer Venta De Viagra En Gibraltar levitra 10 mg generic Baclofen En Ligne 25mg Propecia What Is Drug Interactions
#15
Posted 30/10/2017, 01:23
Qualityrxpharmacy Generic On Line Levaquin Cod Accepted online pharmacy Viagra Como Comprar Cialis Ohne Rezept Hamburg
Buy Zithromax Overnight viagra prescription Propecia Billig Viagra Et Generique Priligy Sur Le Nhs
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)