8 lines
297 B
JavaScript
8 lines
297 B
JavaScript
|
InputTime()
|
||
|
function InputTime() {
|
||
|
let currentTime = new Date();
|
||
|
let options = { timeStyle: 'short', hour12: true };
|
||
|
let timeString = currentTime.toLocaleTimeString('en-US', options);
|
||
|
document.querySelector('#main-clock').innerHTML = `${timeString}`
|
||
|
}
|
||
|
setInterval(InputTime, 1000);
|