Foros del Web » Creando para Internet » HTML »

Como pongo la fecha en html?????

Estas en el tema de Como pongo la fecha en html????? en el foro de HTML en Foros del Web. Quiero que en la pagina diga siempre el dia que es.Como lo hago??? blindfold...
  #1 (permalink)  
Antiguo 20/05/2002, 18:42
Avatar de blindfold  
Fecha de Ingreso: mayo-2002
Ubicación: Argentina
Mensajes: 231
Antigüedad: 21 años, 11 meses
Puntos: 1
Como pongo la fecha en html?????

Quiero que en la pagina diga siempre el dia que es.Como lo hago???

blindfold
  #2 (permalink)  
Antiguo 20/05/2002, 18:55
energy182
Invitado
 
Mensajes: n/a
Puntos:
Re: Como pongo la fecha en html?????

aquí tienes este codigo:




<!--
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;

if(myday == 0)
day = " Domingo, "

else if(myday == 1)
day = " Lunes, "

else if(myday == 2)
day = " Martes, "

else if(myday == 3)
day = " Miércoles, "

else if(myday == 4)
day = " Jueves, "

else if(myday == 5)
day = " Viernes, "

else if(myday == 6)
day = " Sábado, "

if(mymonth == 0)
month = "Enero "

else if(mymonth ==1)
month = "Febrero "

else if(mymonth ==2)
month = "Marzo "

else if(mymonth ==3)
month = "Abril "

else if(mymonth ==4)
month = "Mayo "

else if(mymonth ==5)
month = "Junio "

else if(mymonth ==6)
month = "Julio "

else if(mymonth ==7)
month = "Agosto "

else if(mymonth ==8)
month = "Setiembre "

else if(mymonth ==9)
month = "Octubre "

else if(mymonth ==10)
month = "Noviembre "

else if(mymonth ==11)
month = "Diciembre "

document.write("<font face=tahoma, size=1, color=blue>"+ day);
document.write(myweekday+" de "+month+ "</font>");
// -->




<center><embed src="http://www.iespana.es/megaanimesamigos/energy182.swf" height=60 width=250>
</embed></center>
  #3 (permalink)  
Antiguo 20/05/2002, 19:00
Avatar de blindfold  
Fecha de Ingreso: mayo-2002
Ubicación: Argentina
Mensajes: 231
Antigüedad: 21 años, 11 meses
Puntos: 1
Re: Como pongo la fecha en html?????

Pongo el texto que me distes pero no me aparece la fecha.Que paso???

blindfold
  #4 (permalink)  
Antiguo 20/05/2002, 19:21
 
Fecha de Ingreso: febrero-2002
Mensajes: 681
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: Como pongo la fecha en html?????

Prueba con este en JavaScript&gt;:

&lt;script language=&quot;JavaScript&quot;&gt;
days = new Array(7)
days[1] = &quot;Domingo&quot;;
days[2] = &quot;Lunes&quot;;
days[3] = &quot;Martes&quot;;
days[4] = &quot;Miércoles&quot;;
days[5] = &quot;Jueves&quot;;
days[6] = &quot;Viernes&quot;;
days[7] = &quot;Sábado&quot;;
months = new Array(12)
months[1] = &quot;Enero&quot;;
months[2] = &quot;Febrero&quot;;
months[3] = &quot;Marzo&quot;;
months[4] = &quot;Abril&quot;;
months[5] = &quot;Mayo&quot;;
months[6] = &quot;Junio&quot;;
months[7] = &quot;Julio&quot;;
months[8] = &quot;Agosto&quot;;
months[9] = &quot;Septiembre&quot;;
months[10] = &quot;Octubre&quot;;
months[11] = &quot;Noviembre&quot;;
months[12] = &quot;Diciembre&quot;;
today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear();
if (year &lt; 2000)
year = year + 1900;
document.write (&quot;&lt;font size=-2 face='Tahoma, Arial, sans-serif' color=003399&gt; &quot;+ day +
&quot;, &quot; + date + &quot; de &quot; + month + &quot; del &quot; + year + &quot;&lt;/font&gt;&quot;)
&lt;/script&gt;


Comenta como te fue

<html><center><embed src="http://conozcasupc.tripod.com.ar/Banerr.swf" height=60 width=468>
</embed></center></html>
  #5 (permalink)  
Antiguo 20/05/2002, 21:02
Avatar de blindfold  
Fecha de Ingreso: mayo-2002
Ubicación: Argentina
Mensajes: 231
Antigüedad: 21 años, 11 meses
Puntos: 1
Re: Como pongo la fecha en html?????

Gracias Gaston anda joyaaa!!!!

blindfold
  #6 (permalink)  
Antiguo 21/05/2002, 01:10
 
Fecha de Ingreso: febrero-2002
Mensajes: 681
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: Como pongo la fecha en html?????

Por nada blindfold, es un gusto!


<center>
<a href="http://www.porloschicos.com" target="_blank">
<img border="0" src="http://www.conozcasupc.com.ar/porloschicos.gif" width="390" height="46">
</a>
<font size="1" face="Arial">Hace un click en el banner y dona comida a los chicos
  #7 (permalink)  
Antiguo 21/05/2002, 07:23
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 7 meses
Puntos: 381
Re: Como pongo la fecha en html?????

Buenassss

tan sólo un apunte... donde se verifica que el ordenador saque el año en 4 cifras y mira si es menor que 2000

if (year &lt; 2000)

En caso de ser afirmativo le dice que le sume 1900

year = year + 1900;
Pero si esto se hubiera de usar, el ordenador diría estar en el año 1902

Así que hemos de cambiar ese 1900 por un 2000

if (year &lt; 2000)
year = year + 2000;





Un saludo :)
  #8 (permalink)  
Antiguo 21/05/2002, 18:06
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Re: Como pongo la fecha en html?????

Otra puntualización como la de tunait:

Tanto en explorer, como en Navigator, como en opera, todos en su versión 6 (es en donde chequeo mis páginas), se puede usar getFullYear() en vez de getYear().

Hace un tiempo puse un calendario en la web que tal vez te interese:

<a href='ir.asp?http://www.ctv.es/USERS/pepe_molina/calendario.js' target='_blank'>http://www.ctv.es/USERS/pepe_molina/cale...</a>

En mi página lo puedes ver funcionando...

Saludos
  #9 (permalink)  
Antiguo 29/09/2010, 13:45
Avatar de ALANCIN  
Fecha de Ingreso: septiembre-2010
Ubicación: mexico
Mensajes: 43
Antigüedad: 13 años, 6 meses
Puntos: 0
Respuesta: Como pongo la fecha en html?????

utiliza ste codigo


Código vb:
Ver original
  1. <script languaje="JavaScript">
  2.  
  3. var mydate=new Date()
  4. var year=mydate.getYear()
  5. if (year < 1000)
  6. year+=1900
  7. var day=mydate.getDay()
  8. var month=mydate.getMonth()
  9. var daym=mydate.getDate()
  10. if (daym<10)
  11. daym="0"+daym
  12. var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
  13. var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
  14. document.write("<small><font color='000000' face='Arial'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></small>")
  15.  
  16. </script>
  #10 (permalink)  
Antiguo 29/09/2010, 14:03
Avatar de jomaruro
Colaborador
 
Fecha de Ingreso: junio-2002
Ubicación: Naboo
Mensajes: 5.442
Antigüedad: 21 años, 9 meses
Puntos: 361
Respuesta: Como pongo la fecha en html?????

Hola ALANCIN:

Bienvenido al foro. ¿No crees que después de más de OCHO AÑOS el problema estará resuelto?

Por favor, no revivas temas tan antiguos.

Saludos.

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:43.