User:Admin
From Rodas Familia
Line 1: | Line 1: | ||
{{Contador}} | {{Contador}} | ||
+ | |||
+ | <!-- Copiar este código dentro del tag BODY --> | ||
+ | |||
+ | <body> | ||
+ | <script> | ||
+ | |||
+ | var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") | ||
+ | |||
+ | function countup(yr,m,d){ | ||
+ | var today=new Date() | ||
+ | var todayy=today.getYear() | ||
+ | if (todayy < 1000) | ||
+ | todayy+=1900 | ||
+ | var todaym=today.getMonth() | ||
+ | var todayd=today.getDate() | ||
+ | var todaystring=montharray[todaym]+" "+todayd+", "+todayy | ||
+ | var paststring=montharray[m-1]+" "+d+", "+yr | ||
+ | var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1) | ||
+ | difference+=" días" | ||
+ | document.write("Hace "+difference+" que esta web esta online!") | ||
+ | } | ||
+ | //NOTA: Cambia en la linea de abajo, el dia desde el que quieres contar el tiempo | ||
+ | countup(2001,04,14) | ||
+ | |||
+ | </script></body> |
Revision as of 16:13, 8 November 2006
<body>
<script>
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countup(yr,m,d){ var today=new Date() var todayy=today.getYear() if (todayy < 1000) todayy+=1900 var todaym=today.getMonth() var todayd=today.getDate() var todaystring=montharray[todaym]+" "+todayd+", "+todayy var paststring=montharray[m-1]+" "+d+", "+yr var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1) difference+=" días" document.write("Hace "+difference+" que esta web esta online!") } //NOTA: Cambia en la linea de abajo, el dia desde el que quieres contar el tiempo countup(2001,04,14)
</script></body>