Ejemplos en Javascript

Fecha y hora de entrada en una página web

Este script verifica la hora y la fecha del ordenador cliente y te avisa por escrito de cuándo has entrado en la página.

<HTML>
<HEAD>

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


</HEAD>

<BODY bgcolor="white">


<script language=vbscript>
<!--
 
d=weekday(date)
if d=1 then
today="Sunday"
elseif d=2 then
today="Monday"
elseif d=3 then
today="Tuesday"
elseif d=4 then
today="Wednesday"
elseif d=5 then
today="Thursday"
elseif d=6 then
today="Friday"
elseif d=7 then
today="Saturday"
end if
m=month(date)
if m=1 then
mon="January"
elseif m=2 then
mon="February"
elseif m=3 then
mon="March"
elseif m=4 then
mon="April"
elseif m=5 then
mon="May"
elseif m=6 then
mon="June"
elseif m=7 then
mon="July"
elseif m=8 then
mon="August"
elseif m=9 then
mon="September"
elseif m=10 then
mon="October"
elseif m=11 then
mon="November"
elseif m=12 then
mon="December"
end if
 
document.Write "<b>

You entered this site on"
document.Write " " & today & ", " & mon & " " & day(now) & " " & year(date)
document.Write " at " & Time()
//-->
</script>


</body>
</html>

Fechas y horarios