function updateDateTime() { const el = document.getElementById("datetime"); if (!el) return; const now = new Date(); const weekdays = [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", ]; const dayName = weekdays[now.getDay()]; const day = String(now.getDate()).padStart(2, "0"); const month = String(now.getMonth() + 1).padStart(2, "0"); const year = now.getFullYear(); const hours = String(now.getHours()).padStart(2, "0"); const minutes = String(now.getMinutes()).padStart(2, "0"); el.textContent = `${dayName} ${day}.${month}.${year} ${hours}:${minutes}`; } updateDateTime(); setInterval(updateDateTime, 1000);