Hi Folks hope you can help I am trying to add the date to a website in the format Sunday the 11th of May 2014 all I am getting is Sunday the 11 May 2014. I am very new at this so could you explain in plain terms. I think the problem is from var nth onwards. Many thanks for your help.
Chris
var dayName;dayName = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];var monName;monName = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];var now;now = new Date();var stamp;stamp = new Date();var today;today = stamp.getDate();var theDate = now.getDate();var nth = '';if (theDate > 3 && theDate < 21) // catch teens, which are all 'th' nth = theDate + 'th';else if (theDate % 10 == 1) // exceptions ending in '1' nth = theDate + 'st';else if (theDate % 10 == 2) // exceptions ending in '2' nth = theDate + 'nd';else if (theDate % 10 == 3) // exceptions ending in '3' nth = theDate + 'rd';else nth = theDate + 'th';document.write(dayName[now.getDay()] + " the " + thedate() +", " + "of " + monName[now.getMonth()] + ", " + now.getFullYear());