Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<html>
<head>
<title>Standard Uhr</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function clock() {
//ZEIT
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
if(hours<10){
hours = "0"+hours;
}
if(minutes<10){
minutes = "0"+minutes;
}
if(seconds<10){
seconds = "0"+seconds;
}
var timeString = ""+hours+":"+minutes+":"+seconds;
//DATUM
var weekdays = new Array('So','Mo','Di','Mi','Do','Fr','Sa');
var day = now.getDate();
var weekday = now.getDay();
var month = now.getMonth();
var year = now.getYear();
if(day<10){
day = "0"+day;
}
if(month<10){
month = "0"+month;
}
var timeString = ""+hours+":"+minutes+":"+seconds;
window.document.getElementById("uhr").innerHTML= timeString;
var dateString = ""+weekdays[weekday]+", "+day+"-"+month+"-"+year;
window.document.getElementById("datum").innerHTML= dateString;
window.setTimeout("clock();", 1000);
}
</script>
</head>
<body onLoad="clock()">
<span id="uhr" style="font-size:10pt; color:#FF0000;">uhr</span>
<span id="datum" style="font-size:10pt; color:#FF0000;">datum</span>
</body>
</html>
<HEAD>
<script type="text/javascript">
<!--
function uhr() {
var jetzt = new Date();
var h = jetzt.getHours();
if (h<10) {
h = "0"+h;
}
var min = jetzt.getMinutes();
if (min<10) {
min = "0"+min;
}
var sec = jetzt.getSeconds();
if (sec<10) {
sec = "0"+sec;
}
document.getElementById("uhr").innerText = h+':'+min+':'+sec;
}
//-->
</script>
</HEAD>
<BODY onload="window.setInterval('uhr()',1000); uhr()">
<p id="uhr"> </p>