<script>
window.onload = function() {
var timeStr, dateStr;
clock();
}
function clock() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
timeStr = ((hours < 10) ? '0' : '') + hours;
timeStr += ((minutes < 10) ? ':0' : ':') + minutes;
timeStr += ((seconds < 10) ? ':0' : ':') + seconds;
var date = now.getDate();
var month = now.getMonth() + 1;
var year = now.getFullYear() % 100;
dateStr = ((date < 10) ? '0' : '') + date;
dateStr += ((month < 10) ? '-0' : '-') + month;
dateStr += ((year < 10) ? '-0' : '-') + year;
datetime.innerHTML = dateStr + ' ' + timeStr;
setTimeout('clock()', 1000);
}
</script>
<div id="datetime"></div>