How to display date on website>
Get date script>
Code:
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function returnDate() {
var this_month = new Array(12);
this_month[0] = "January";
this_month[1] = "February";
this_month[2] = "March";
this_month[3] = "April";
this_month[4] = "May";
this_month[5] = "June";
this_month[6] = "July";
this_month[7] = "August";
this_month[8] = "September";
this_month[9] = "October";
this_month[10] = "November";
this_month[11] = "December";
var this_day = new Array(7);
this_day[0] = "Sunday";
this_day[1] = "Monday";
this_day[2] = "Tuesday";
this_day[3] = "Wednesday";
this_day[4] = "Thursday";
this_day[5] = "Friday";
this_day[6] = "Saturday";
var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = today.getYear();
var weekday = today.getDay();
if (year< 1900)
year += 1900;
SrcStr = (this_day[weekday]+", "+day+" "+this_month[month]+", "+year);
document.write(SrcStr);
}
// -->
</script>
and to display>
Code:
<script language="JavaScript" type="text/javascript">returnDate();</script>
Easy !!!
Bookmarks