Something went wrong. Try again.
An attempt to showcase digitally, what's going-on at Inovus Labs. Something similar to Discord Rich Presence or Tinkerspace Digital live.inovuslabs.org
Something went wrong. Try again.
2.0 kB 55 lines
at dev
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455<nav class="navbar navbar-light navbar-div mx-5"> <a class="navbar-brand" href="#"><span class="record-icon"><i class="bi bi-record-fill"></i></span><span class="brand-name"> LIVE @ INOVUS LABS // </span><span class="clock" id="clock"></span></a> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link" href="#"><span class="date" id="date"></span></a> </li> </ul></nav>
<script> function updateClock() { var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var seconds = currentTime.getSeconds();
// Add leading zeros if needed hours = (hours < 10 ? "0" : "") + hours; minutes = (minutes < 10 ? "0" : "") + minutes; seconds = (seconds < 10 ? "0" : "") + seconds;
// Choose between 12-hour and 24-hour format var timeFormat = hours >= 12 ? "PM" : "AM"; hours = hours % 12; hours = hours ? hours : 12; // Handle midnight var currentTimeString = hours + ":" + minutes + ":" + seconds + " " + timeFormat;
document.getElementById("clock").innerText = currentTimeString; }
// Update the clock every second setInterval(updateClock, 1000);
// Initial call to display the clock immediately updateClock();
function displayCurrentDate() { var currentDate = new Date(); var day = currentDate.getDate(); var month = currentDate.getMonth() + 1; // Months are zero indexed var year = currentDate.getFullYear();
// Format the date as dd/mm/yyyy var formattedDate = (day < 10 ? '0' : '') + day + '/' + (month < 10 ? '0' : '') + month + '/' + year;
document.getElementById('date').textContent = formattedDate; }
// Display the current date initially displayCurrentDate();
// Update the date every second setInterval(displayCurrentDate, 1000);</script>