(function () {
  function updateDateTime() {
    const el = document.getElementById("datetime");
    if (!el) return;

    const now = new Date();

    const date = now.toLocaleDateString("de-DE");

    const time = now.toLocaleTimeString("de-DE", {
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit",
    });

    el.textContent = `${date} - ${time}`;
  }

  updateDateTime();
  setInterval(updateDateTime, 1000);
})();
