Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/05/2005, 08:24
Avatar de RootK
RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 3 meses
Puntos: 50
Asi es... eso lo haces con javascript..

Es sencillo... te pongo un ejemplo.

Coloca éste dentro de los headers..

Cita:
<SCRIPT LANGUAGE="JavaScript">
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = "" + ((hours >12) ? hours -12 :hours)

if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.getElementById('Label1').innerText = timeValue;

timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
</SCRIPT>
Despues colocas la label tan cual en tu mismo modo html:

Cita:
<asp:Label id="Label1" runat="server" />
y simplemente para que se ejecute inicializalo en el body:

Cita:
<body onLoad="startclock()">
Y listo... te muestra la hora con lo segundos corriendo..


Cualquier cosa por aqui andamos...