Guía práctica de HTML

Script de Fecha en Visual Basic para Internet Explorer

Regreso a Guía de HTML

Este Script se utiliza para colocar la fecha actual en cualquier parte de la página. En el presente ejemplo se colocó dentro de una tabla centrada con ancho del 40%.

<center><table border=1 cellpadding=3 cellspacing=3 width=40%>
<tr><td align=center>
  <B>
      <SCRIPT LANGUAGE="VBScript">
         <!--
        d=weekday(date)

        if d = 1 then
          today="Domingo"
        elseif d = 2 then
          today="Lunes"
        elseif d = 3 then
          today="Martes"
        elseif d = 4 then
          today="Miércoles"
        elseif d = 5 then
          today="Jueves"
        elseif d = 6 then
          today="Viernes"
        elseif d = 7 then
          today="Sábado"
        end if

        m=month(date)
      
        if m=1 then 
          mon="Enero"
        elseif m=2 then 
          mon="Febrero"
        elseif m=3 then
          mon="Marzo"
        elseif m=4 then
          mon="Abril"
        elseif m=5 then
          mon="Mayo"
        elseif m=6 then 
          mon="Junio"
        elseif m=7 then
          mon="Julio"
        elseif m=8 then 
          mon="Agosto"
        elseif m=9 then
          mon="Septiembre"
        elseif m=10 then
          mon="Octubre"
        elseif m=11 then 
          mon="Noviembre"
        elseif m=12 then 
          mon="Diciembre"
        end if

        Document.Write today & " " & day(now) & " de " & mon & "."
        -->
      </SCRIPT>
      </B>
</td></tr></table></center>

Esta Guía fué preparada por Carlos Crismatt Mouthon E-mail: crismatt@hotmail.com