Código 1:
<script languaje="JavaScript">
//<![CDATA[
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<b><font color='blue' face='Arial' size='3'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" del "+year+"</font></b>")
//]]>
</script>
Código 2:
<script languaje="JavaScript">
//<![CDATA[
var mydate=new Date();
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay();
var month=mydate.getMonth()+1;
if (month<10)
month="0"+month;
var daym=mydate.getDate();
if (daym<10)
daym="0"+daym;
document.write("<b><font color='000000' face='Arial' size='3'>"+daym+"/"+month+"/"+year+"</font></b>")
//]]>
</script>
Código 3:
<script languaje="JavaScript">
//<![CDATA[
var mydate=new Date();
var year=mydate.getYear()-100;
if (year<10)
year="0"+year;
var day=mydate.getDay();
var month=mydate.getMonth()+1;
if (month<10)
month="0"+month;
var daym=mydate.getDate();
if (daym<10)
daym="0"+daym;
document.write("<b><font color='000000' face='Arial' size='3'>"+daym+"/"+month+"/"+year+"</font></b>")
//]]>
</script>
Código 4:
<div style="background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS0IeDyMA2qLe6uC5HSru19s31bTtjhu2PMDK4GfCtraKrGl72L2Qx5INtB6PCQ-AT4ejmdMx5snXL5DQCj4C0onkQ5mYjXqHs3sMFaMMcwAFvqS5zmK495DtdsLh7bY-6KJUN_6jqIUE4/s1600/reloj-fecha-actual.jpg);background-repeat: no-repeat;width:200px;height:95px;text-align: center;font-size:70px;color:#fff;padding-top:35px;"><script languaje="JavaScript">
//<![CDATA[
var mydate=new Date();
var year=mydate.getYear()-100;
if (year<10)
year="0"+year;
var day=mydate.getDay();
var month=mydate.getMonth()+1;
if (month<10)
month="0"+month;
var daym=mydate.getDate();
if (daym<10)
daym="0"+daym;
document.write("<b><font color='ffffff' face='Arial'>"+daym+" "+month+" "+year+"</font></b>")
//]]>
</script></div>
El código 3 y 4 funciona solo en Firefox, pero igualmente pueden ver el ejemplo con el div para personalizarlo.
No hay comentarios:
Publicar un comentario