This code shows you how to add the date to your document. To place the date where you want it, simply place the <script> inside of the <body> where you wish to have the date appear.

Source for date.html:

<HTML>
<HEAD>
<SCRIPT Language="Javascript" TYPE="text/javascript">
<!--

//This section creates the current date string
if ((navigator.appName.indexOf('Microsoft Internet Explorer') != -1 ) && (navigator.appVersion.substring(0,1) >= 4)) var intro = 1;
if ((navigator.appName.indexOf('Netscape') != -1 ) && (navigator.appVersion.substring(0,1) >= 4)) var intro = 0;
var dateNumb = new Date();
dateNumb = dateNumb.getDate();
var d = new Date();
d = d.getDay();
var m = new Date();
m = m.getMonth();
var y = new Date();
y = y.getFullYear();

var month = new String();
var dateTH = new String();
var date = new String();
var FullDate = new String();

if (d == 0) var day = 'Sunday';
else if (d == 1) var day = 'Monday';
else if (d == 2) var day = 'Tuesday';
else if (d == 3) var day = 'Wednesday';
else if (d == 4) var day = 'Thursday';
else if (d == 5) var day = 'Friday';
else if (d == 6) var day = 'Saturday';

if (m == 0) var month = 'January';
else if (m == 1) var month = 'February';
else if (m == 2) var month = 'March';
else if (m == 3) var month = 'April';
else if (m == 4) var month = 'May';
else if (m == 5) var month = 'June';
else if (m == 6) var month = 'July';
else if (m == 7) var month = 'August';
else if (m == 8) var month = 'September';
else if (m == 9) var month = 'October';
else if (m == 10) var month = 'November';
else if (m == 11) var month = 'December';

if ((dateNumb == 1) || (dateNumb == 21) || (dateNumb == 31)) dateTh = 'st'; //.sup();
else if ((dateNumb == 2) || (dateNumb == 22)) dateTH = 'nd'; //.sup();
else if ((dateNumb == 3) || (dateNumb == 23)) dateTH = 'rd'; //.sup();
else dateTH = 'th'; //.sup();
date = dateNumb + dateTH;
FullDate = day + ', ' + month + ' ' + date + ', ' + y;

// -->
</script>
</HEAD>

<BODY>

<B>
<script>
document.write(FullDate);
</script>
</b>

</BODY>
</HTML>


Back