-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (62 loc) · 1.71 KB
/
index.html
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
<!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>Analog responsiv clock </title>
<link rel="stylesheet" href="style.css">
<script src="index.js"></script>
</head>
<style>
.container {
font-size: 23px;
background-color: #4e5c83;
border: 2px solid rgb(13, 2, 55);
padding: 10px;
margin: 4px;
text-align: center;
}
#time {
font-weight: bold;
}
</style>
<body>
<!-- digital clock -->
<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(1000);
console.log(dt);
// let newDate = new Date("2029-09-30");
// console.log(newDate)
// let newDate = new Date(year, month, date, hours, minutes, seconds, milliseconds);
let newDate = new Date(3020, 4, 6, 9, 3, 2, 34);
console.log(newDate);
let yr = newDate.getFullYear();
console.log("The year is ", yr);
let dat = newDate.getDate();
console.log("The date is ", dat);
let month = newDate.getMonth();
console.log("The month is ", month);
let hours = newDate.getHours();
console.log("The hours is ", hours);
newDate.setDate(8);
newDate.setMinutes(29);
console.log(newDate)
setInterval(updateTime, 1000);
function updateTime() {
time.innerHTML = new Date();
}
</script>
<div id="ClockContainer">
<div id="hour"></div>
<div id="minute"></div>
<div id="second"></div>
</div>
</body>
</html>