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
| <html>
<body onload="rebourd()">
<script language="javascript">
var heure = 21;
var minutes1 = 00;
var secondes = 00;
function rebourd()
{
today = new Date();
hours = today.getHours();
minutes = today.getMinutes();
seconds = today.getSeconds();
timeValue = hours;
time = minutes1*60 + heure*3600 + secondes;
time1 = hours * 3600 + minutes*60 +seconds;
timerestant = Math.abs(time1 - time);
if(secondes == 00)
secrestant = 60 - seconds;
else
secrestant = secondes - seconds;
hrestant = Math.floor(timerestant/3600);
minrestant = Math.floor((timerestant - (hrestant*3600))/60);
document.getElementById("timer").innerHTML = hrestant + ' h ' + minrestant + ' m ' + secrestant + 'sec';
timerID = setTimeout("rebourd()",1000);
}
</script>
<div id="timer"></div>
</body>
</html> |
Partager