/***********************************************
* Hiển thị thời gian
* Hiển thị ngày tháng năm
***********************************************/

var today = new Date();
var thisHours = today.getHours();
var thisMinutes = today.getMinutes();
var ap='AM';
if(thisHours > 12)
{ 
	ap='PM';
}
 
var weekdayNames = ["Chủ nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy"];
var monthNamesR = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
var thisDay = today.getDay();
var thisDate = today.getDate();
var currMonth = today.getMonth();
var currYear = today.getFullYear();
if(today.getMinutes() < 10) {thisMinutes = "0" + today.getMinutes()};
if(today.getHours() < 10) {thisHours = "0" + today.getHours()};
	 
function datetime() 
{ 
	document.write(weekdayNames[thisDay] + ", " + thisDate + "." + monthNamesR[currMonth] + "." + currYear + ", " + thisHours + ":" + thisMinutes + " " + ap)  
}
