-
Notifications
You must be signed in to change notification settings - Fork 0
/
A7.html
38 lines (35 loc) · 1015 Bytes
/
A7.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
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1.transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Current Date</title>
<script type="text/javascript">
var d_names=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var m_names=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var d=new Date();
var curr_day=d.getDay();
var curr_date=d.getDate();
var sup="";
if(curr_date==1||curr_date==21||curr_date==31)
{
sup="st";
}
else if(curr_date==2||curr_date==22)
{
sup="nd";
}
else if(curr_date==3||curr_date==23)
{
sup="rd";
}
else
{
sup="th";
}
var curr_month=d.getMonth();
var curr_year=d.getFullYear();
document.write("<h1><center>"+d_names[curr_day]+""+curr_date+"<SUP>"+sup+"</SUP>"+m_names[curr_month]+""+curr_year+"</center></h1>");
</script>
</head>
<body bgcolor="cyan">
</body>
</html>