Hola
lopmorjo
Prueba este ejemplo:
Código PHP:
<html>
<head>
<script type="text/javascript">
function horas() {
hora = new Date();
h = hora.getHours();
m = hora.getMinutes();
if (m<10) m = '0'+ m;
s = hora.getSeconds();
if (s<10) s = '0'+ s;
return (h+':'+m+':'+s);
}
</script>
</head>
<body>
<form>
<textarea name="txt"></textarea>
<input type="button" value="Hora" onclick = "txt.value = horas()" />
</form>
</body>
</html>
Saludos,