-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut34(My clock).htm
More file actions
76 lines (55 loc) · 1.72 KB
/
tut34(My clock).htm
File metadata and controls
76 lines (55 loc) · 1.72 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Date And Time in Javascript</title>
<style>
.container {
font-size: 45px;
background-color: blanchedalmond;
padding: 23px 34px;
margin: 5px;
text-align: center;
}
#time {
font-weight: 100;
}
</style>
</head>
<body>
<div class="container">
Current Time is <span id="time"></span>
</div>
<script>
console.log("This is Date and Time Tutorial");
// let now = new Date();
// console.log(now);
// let dt = new Date(0);
// console.log(dt);
// let newDate = new Date(year, month, date, hours ,minutes,seconds,milliseconds );
// let newDate = new Date(3020, 4, 5, 6, 2, 30, 4000);
// console.log(newDate)
// let dt = newDate.getDate();
// console.log("The date is " + dt)
// let mo = newDate.getMonth();
// console.log("The minutes is " + mo)
// let hr = newDate.getHours();
// console.log("The hours is " + hr)
// let min = newDate.getMinutes();
// console.log("The minutes is " + min);
// let day = newDate.getDay();
// console.log("The day is " + day);
// newDate.setDate(35);
// console.log(newDate)
// newDate.getMinutes(30);
// console.log(newDate);
// Date.now();
function updateTime() {
time.innerHTML = new Date();
}
setInterval(updateTime, 1000);
</script>
</body>
</html>