forked from primalkz/startpage-catppuccin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (21 loc) · 783 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function showTime() {
const date = new Date();
let today = date.toLocaleString("en", { weekday: "long" });
let hour = date.toLocaleString("pl", { hour: "2-digit" }); // use 24h time format
let minute = date.toLocaleString("en", { minute: "2-digit" });
let second = date.toLocaleString("en", { second: "2-digit" });
let day = date.toLocaleString("en", { day: "2-digit" });
let month = date.toLocaleString("en", { month: "2-digit" });
let year = date.toLocaleString("en", { year: "numeric" });
minute = addZero(minute);
second = addZero(second);
document.getElementById(
"date"
).innerHTML = `${today}, ${hour}:${minute}:${second} | ${day}/${month}/${year}`;
setTimeout(showTime, 0);
}
function addZero(i) {
if (i.length < 2) i = "0" + i;
return i;
}
showTime();