-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode57.html
41 lines (32 loc) · 840 Bytes
/
code57.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
<!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</title>
</head>
<body>
<p>My Clock!</p>
<span id="time"></span>
<script>
let dt=new Date();
console.log(dt);
// let ndt=new Date(2000);
// console.log(ndt);
//another way of intiallizing Data
let d1=new Date('2020-11-05');
console.log(d1);
//setting date ,day,time etc
d1.setDate(6);
d1.setFullYear(2021);
console.log(d1);
//making clock
setInterval(updatetime,1000);
function updatetime()
{
time.innerHTML=new Date();
}
</script>
</body>
</html>