-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdate.html
More file actions
29 lines (21 loc) · 830 Bytes
/
date.html
File metadata and controls
29 lines (21 loc) · 830 Bytes
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
<html>
<head>
<title>JavaScript Date constructor Property</title>
</head>
<body>
<script type="text/javascript">
var dt = new Date();
document.write("dt.constructor is : " + dt.constructor);
var dt = new Date();
document.write("<br>date : " + dt);
document.write("<br>date : " + dt.getDate()); //date only
document.write("<br>day no: " + dt.getDay()); //day no
document.write("<br>full year: " + dt.getFullYear()); //fullyear
document.write("<br>Hours : " + dt.getHours()); //hours
document.write("<br>millisecounds : " + dt.getMilliseconds()); //day no
document.write("<br>minutes : " + dt.getMinutes());
document.write("<br>getMonth() : " + dt.getMonth() );
document.write("<br>getSeconds() : " + dt.getSeconds() );
</script>
</body>
</html>