Affichage 24h Affichage 12 h
HEURES SIMPLE 3
Codes à insérer sur la ligne <BODY> Exemple: <BODY onload="showTheTime()">
onload="showTheTime()" Cliquez ici pour tout sélectionner
Codes à insérer entre les balises <HEAD> et </HEAD> de votre document HTML
<script language="JavaScript"> <!-- Begin function showMilitaryTime() { if (document.form.showMilitary[0].checked) { return true; } return false; } function showTheHours(theHour) { if (showMilitaryTime() || (theHour > 0 && theHour < 13)) { if (theHour == "0") theHour = 12; return (theHour); } if (theHour == 0) { return (12); } return (theHour-12); } function showZeroFilled(inValue) { if (inValue > 9) { return "" + inValue; } return "0" + inValue; } function showAmPm() { if (showMilitaryTime()) { return (""); } if (now.getHours() < 12) { return (" am"); } return (" pm"); } function showTheTime() { now = new Date document.form.showTime.value = showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + ":" + showZeroFilled(now.getSeconds()) + showAmPm() setTimeout("showTheTime()",1000) } // End --> </script> Cliquez ici pour tout sélectionner
Codes à insérer entre les balises <BODY> et </BODY> de votre document HTML
<form name="form"> <p align="center"><input type="text" size="11" name="showTime"></p> <p align="center"><input type="radio" checked name="showMilitary">Affichage 24h<br> <input type="radio" name="showMilitary">Afichage 12 h<br> </p> </form> Cliquez ici pour tout sélectionner