New files.
This commit is contained in:
16
script.js
Normal file
16
script.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// Time Widget.
|
||||
function updateTime() {
|
||||
const now = new Date();
|
||||
const options = {
|
||||
timeZone: 'Europe/Warsaw',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
hour12: false
|
||||
};
|
||||
const timeString = now.toLocaleTimeString('en-US', options);
|
||||
document.getElementById('time').textContent = timeString;
|
||||
}
|
||||
|
||||
updateTime();
|
||||
setInterval(updateTime, 1000);
|
||||
Reference in New Issue
Block a user