Posted By

rotarypot on 01/05/07


Tagged

fecha actual


Versions (?)

Hoy es


 / Published in: JavaScript
 

funcion para obtener la fecha de hoy

  1. <script language="JavaScript">
  2. <!--
  3. var months = new Array(12)
  4. months[1] = "January";
  5. months[2] = "February";
  6. months[3] = "March";
  7. months[4] = "April";
  8. months[5] = "May";
  9. months[6] = "June";
  10. months[7] = "July";
  11. months[8] = "August";
  12. months[9] = "September";
  13. months[10] = "October";
  14. months[11] = "November";
  15. months[12] = "December";
  16.  
  17.  
  18. var today = new Date()
  19. var month = months[today.getMonth() + 1]
  20. var date = today.getDate()
  21. var year = today.getYear()
  22. if (year >= 100 && year <= 1999)
  23. {year=year + 1900}
  24. else
  25. {year=year}
  26.  
  27. //-->
  28. </script>

Report this snippet  

You need to login to post a comment.