function writedate() {
months= new Array();
months[0]="January";
months[1]="February";
months[2]="March";
months[3]="April";
months[4]="May";
months[5]="June";
months[6]="July";
months[7]="August";
months[8]="September";
months[9]="October";
months[10]="November";
months[11]="December";

Stamp = new Date();
var lastdigit;
lastdigit=Stamp.getDate() % 10;
ending="th";
if ( (Stamp.getDate()<4) || (Stamp.getDate()>20) ) {
if ( lastdigit==1 ) {ending="st";}
if ( lastdigit==2 ) {ending="nd";}
if ( lastdigit==3 ) {ending="rd";}
}
ending="<SUP>"+ending+"</SUP>";
var theyear;
theyear=Stamp.getYear();
if ( theyear<1900 ) {theyear=theyear+1900}
document.write(Stamp.getDate()+ending +" "+(months[Stamp.getMonth()])+ " "+theyear );
}
