var months = ["Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var day = function (day) {
	// 1st
	if (day == "1" || day == "21" || day == "31") {
		return day + "st";
	}
	
	// 2nd
	if (day == "2" || day == "22") {
		return day + "nd";	
	}
	
	// 3rd
	if (day == "3" || day == "23") {
		return day + "rd";	
	}
	return day + "th";
}
var am_pm = "";
var hour = function (hour) {
	am_pm = "AM";
	if (hour > 12) {
		am_pm = "PM";
		hour -= 12;
	}
	
	return lead0(hour);
};

var lead0 = function (i) {
	if (i < 10) {
		return "0" + i;
	}
	return i;
};

function setdatetime()
		{
			i = baseD.getSeconds() + 1;
			var d = baseD;
			d.setSeconds(i);
			$('.clock').html(
				'' +
				months[d.getMonth()] +
				' ' +
				day(d.getDate()) +
				' ' +
				hour(d.getHours()) + 
				':' + 
				lead0(d.getMinutes()) + 
				':' + 
				lead0(d.getSeconds()) +
				' ' +
				am_pm
			);
		}