23 lines
536 B
JavaScript
23 lines
536 B
JavaScript
{6fee1011fdf695fafc9ff359268b0facbdebb69b true 536 main.js 0xc001df72d0}
function showTime() {
|
|
'use strict';
|
|
|
|
var now = new Date(),
|
|
hours = now.getHours(),
|
|
minutes = now.getMinutes(),
|
|
seconds = now.getSeconds();
|
|
|
|
if (hours < 10){
|
|
hours = '0' + hours;
|
|
}
|
|
if (minutes < 10){
|
|
minutes = '0' + minutes;
|
|
}
|
|
if (seconds < 10){
|
|
seconds = '0' + seconds;
|
|
}
|
|
document.getElementById('clock').textContent = hours + ':' + minutes + ':' + seconds;
|
|
};
|
|
window.onload = function(){
|
|
'use strict';
|
|
setInterval(showTime, 500);
|
|
};
|