x = new Date()
my_day= x.getDay()
my_month =x.getMonth()
the_date = x.getDate()
the_year = x.getYear()
 if(the_year < "2002")
		 {
     the_year+=1900
     }
var my_days= new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
//alert(my_days[my_day])
var my_months= new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October" ,"November", "December")
//this bit below gets the date from the array
//alert(my_months[my_month])
if (the_date == 1 || the_date == 21 || the_date ==31){
var sup ="<sup>st</sup>"
}
else if (the_date == 2|| the_date == 22){
var sup ="<sup>nd</sup>"
}
else if (the_date == 3 || the_date == 23){
var sup ="<sup>rd</sup>"
}
else 
 sup ="<sup>th</sup>"
 document.write(my_days[my_day]+ " " + "|" +" " + my_months[my_month]+ " | " + " " + the_date + sup + " | " + the_year)