updatetime.js
1.98 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//JS function to update the time every minute
function updateTime(){
var d = new Date();
var hour= d.getHours();
var minute=d.getMinutes();
var day=d.getDay();
var month=d.getMonth();
var month_number=d.getMonth();
var year=d.getFullYear();
var second=d.getSeconds();
var datum=d.getDate();
document.getElementById("hour").innerHTML = hour;
var min;
if(minute==0){min="00"}
else if(minute==1){min="01";}
else if(minute==2){min="02";}
else if(minute==3){min="03";}
else if(minute==4){min="04";}
else if(minute==5){min="05";}
else if(minute==6){min="06";}
else if(minute==7){min="07";}
else if(minute==8){min="08";}
else if(minute==9){min="09";}
else min=minute;
document.getElementById("minute").innerHTML = min;
var stunde;
if(hour==0){stunde="00"}
else if(hour==1){stunde="01";}
else if(hour==2){stunde="02";}
else if(hour==3){stunde="03";}
else if(hour==4){stunde="04";}
else if(hour==5){stunde="05";}
else if(hour==6){stunde="06";}
else if(hour==7){stunde="07";}
else if(hour==8){stunde="08";}
else if(hour==9){stunde="09";}
else stunde=hour;
document.getElementById("hour").innerHTML = stunde;
var tag;
if(day==1){tag="Montag";}
else if(day==2){tag="Dienstag";}
else if(day==3){tag="Mittwoch";}
else if(day==4){tag="Donnerstag";}
else if(day==5){tag="Freitag";}
else if(day==6){tag="Samstag";}
else {tag="Sonntag";}
document.getElementById("day").innerHTML = tag;
var monat;
if (month==0){monat="Jan";}
else if (month==1){monat="Feb";}
else if (month==2){monat="Mär";}
else if (month==3){monat="Apr";}
else if (month==4){monat="Mai";}
else if (month==5){monat="Jun";}
else if (month==6){monat="Jul";}
else if (month==7){monat="Aug";}
else if (month==8){monat="Sep";}
else if (month==9){monat="Okt";}
else if (month==10){monat="Nov";}
else {monat="Dez";}
document.getElementById("month").innerHTML = monat;
document.getElementById("datum").innerHTML = datum;
setTimeout(updateTime, 1000);
};
updateTime();
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});