
Como guardar la hora en una base de datos phpmyadmin
Publicado por manuel (1 intervención) el 25/11/2017 18:17:02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<table name = "HORA" style ="width: 250px; height: 24px; position:absolute;left:885px; top:185px;" id="reloj" border='0'>
<tr>
<td><div id='hora'></div></td>
<td><div>:</div></td>
<td><div id='minuto'></div></td>
<td><div>:</div></td>
<td><div id='segundo'></div></td>
</tr>
</table>
<script type="text/javascript">
Reloj();
function Reloj() {
var tiempo = new Date();
var hora = tiempo.getHours();
var minuto = tiempo.getMinutes();
var segundo = tiempo.getSeconds();
document.getElementById('hora').innerHTML = hora;
document.getElementById('minuto').innerHTML = minuto;
document.getElementById('segundo').innerHTML = segundo;
setTimeout('Reloj()', 1000);
str_hora = new String(hora);
if (str_hora.length == 1) {
document.getElementById('hora').innerHTML = '0' + hora;
}
str_minuto = new String(minuto);
if (str_minuto.length == 1) {
document.getElementById('minuto').innerHTML = '0' + minuto;
}
str_segundo = new String(segundo);
if (str_segundo.length == 1) {
document.getElementById('segundo').innerHTML = '0' + segundo;
}
}
</script>
Valora esta pregunta


-1