PHP:
<html><head><title>CongTruongIT.Com</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function getCurrentTime()
{
var now = new Date();
var mySecs = now.getSeconds();
var curHour = now.getHours();
var curMin = now.getMinutes();
var day = now.getDay();
var date = now.getDate();
var year = now.getFullYear();
var month = now.getMonth();
var days = new Array();
days[0] = "Sunday";
days[1] = "Monday";
days[2] = "Tuesday";
days[3] = "Wednesday";
days[4] = "Thursday";
days[5] = "Friday";
days[6] = "Saturday";
var suffix = "AM";
if(mySecs < 10)
{
mySecs = "0" + mySecs;
}
if(curMin < 10)
{
curMin = "0" + curMin;
}
if(curHour == 12 && curMin >= 1)
{
suffix = "PM";
}
if(curHour == 24 && curMin >= 1)
{
curHour-= 12;
suffix = "AM";
}
if(curHour > 12)
{
curHour-= 12;
suffix = "PM";
}
document.getElementById('time').innerHTML=(days[day] + " " + (month +1) + "/" + date + "/" + year + " " + curHour + ":" + curMin + ":" + mySecs + " " + suffix);
}
</script>
</head>
<body onload="setInterval('getCurrentTime()', 1000);" bgcolor="#FFFFFF" text="#000000">
<div id="time"></div>
</body></html>