const electricDate = document.querySelector(".electronic__date");
const electricTime = document.querySelector(".electronic__clock");
setInterval(checkDateAndTime, 1000);
function checkAddZero(num) {
return num < 10 ? "0" + num : num
}
function checkDateAndTime() {
const DATE = new Date();
const week = ["ВС", "ПОН", "ВТ", "СР", "ЧТ", "ПТ", "СУБ"];
let year = DATE.getFullYear();
let month = checkAddZero(DATE.getMonth() + 1);
let day = checkAddZero(DATE.getDate());
let hour = checkAddZero(DATE.getHours());
let minute = checkAddZero(DATE.getMinutes());
let second = checkAddZero(DATE.getSeconds());
electricDate.innerHTML = year + "-" + month + "-" + day + " " + week[DATE.getDay()];
electricTime.innerHTML = hour + ":" + minute + ":" + second;
}
let d = new Date;
let offset = d.getTimezoneOffset() * 60*1000
d.setTime(d.getTime() - offset)
let matches = d.toISOString().match(/^(.*?)T(.*?)\./)
console.log(matches[1], matches[2]);
console.log(d.toLocaleDateString(undefined, {weekday: 'short'}));
(язык можно прибить гвоздями, а так будет на языке пользователя)