Ejemplos en Javascript

Fecha, hora y días transcurridos desde el inicio del año

Ms Internet Explorer, Netscape

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo prÃ?Æ?Ã?¡ctico </TITLE>


</HEAD>

<BODY bgcolor="white">


<script language="JavaScript">
<!--

  today = new Date();

  start = new Date(today.getYear(),00,01);

  delta = ((today.getTime()-start.getTime()) / 1000 / 60 / 60 / 24);

  document.write("<p>

Hoy es <FONT SIZE=2>",

                  today.getDate(), "/", today.getMonth()+1, "/", today.getYear())

  document.write("</FONT> y son las <FONT SIZE=+2>",

                  today.getHours(), ":", today.getMinutes(), ":", today.getSeconds())

  document.write("</FONT><br>Desde el inicio del aÃ?Æ?Ã?±o han pasado <FONT SIZE=+2>",

                  Math.round(delta), "</FONT> dÃ?Æ?Ã?­as.<p>")

// ---------------------------------------------------------------------->

</SCRIPT>


</body>
</html>

Fechas y horarios