-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (24 loc) · 843 Bytes
/
Copy pathindex.html
File metadata and controls
32 lines (24 loc) · 843 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
30
31
32
<html>
<head>
<title>Example 1 for JavaScript</title>
</head>
<body>
<script type="text/javascript">
var now = new Date();
var day = now.getDate();
var month = now.getMonth() + 1;
var year = now.getYear();
var hours = now.getHours();
var minutes = now.getMinutes();
if (year < 2000) year = year + 1900;
document.write("<h2>Hi!<\/h2><b>Today is the " +
year + "-");
if (month < 10) document.write("0");
document.write(month + "-");
if (day < 10) document.write("0");
document.write(day + ". It is now " + hours + ":");
if (minutes < 10) document.write("0");
document.write(minutes + " o'clock<\/b>");
</script>
</body>
</html>