Mostrando entradas con la etiqueta fecha een el sistema. Mostrar todas las entradas
Mostrando entradas con la etiqueta fecha een el sistema. Mostrar todas las entradas

martes, 14 de marzo de 2017

Funcion.: Poner la fecha en la web

  • Objeto que recoge la fecha del sistema
<script>
        <head>
               function retornarFecha(){
               var fecha;
               fecha=new Date();
               var cadena=fecha.getDate()+'/'+(fecha.getMonth()+1)+
'/'+fecha.getFullYear();
return cadena;

function mostrarFecha()
{
     alert('La fecha de hoy es:  '+retornarFecha());
}

       
</script>
</head>
 <body>

      <p onclick="mostrarFecha()"style="background-color:yellow;">Mostrar fecha</p>

</body>