Also you can replace
with
to get 1st, 2nd, 3rd type days.
Code:
document.write(' ' + myDate.getDate() + ' ');
Code:
var dayofmonth = myDate.getDate(); var datesuffix = 'th'; if ( (dayofmonth < 10) || (dayofmonth > 20) ) suffix = ['th','st','nd','rd'][dayofmonth % 10]; document.write(' ' + dayofmonth + suffix + ' ');
Comment