-
Notifications
You must be signed in to change notification settings - Fork 0
/
tut59.html
35 lines (32 loc) · 1.08 KB
/
tut59.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
<!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>
<div class="container">
This is container
</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, 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);
</script>
</body>
</html>