Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/10/2013, 05:29
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 2 meses
Puntos: 574
Respuesta: como usar el getDate() y setDate(valor)

getDate() Returns the day of the month (from 1-31)

getFullYear() Returns the year (four digits)

getMonth() Returns the month (from 0-11)


Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.  
  3. <p id="demo">Click the button to display dd.mm.yyyy.</p>
  4.  
  5. <button onclick="myFunction()">Try it</button>
  6.  
  7. function myFunction()
  8. {
  9. var d = new Date();
  10. var x = document.getElementById("demo");
  11. var mes=d.getMonth()+1;
  12. x.innerHTML=d.getDate()+"."+mes+"."+d.getFullYear();
  13. }
  14.  
  15. </body>
  16. </html>

Muy complicado no era!!!!
__________________
Quim
--------------------------------------------------
Ayudar a ayudar es una buena práctica!!! Y da buenos resultados.