For html:
<span id="displayDateTime"></span>
for js:
function showDateTime(){ const now = new Date(); const date = now.toLocaleDateString(); const time = now.toLocaleTimeString(); document.getElementById('displayDateTime').textContent = date +''+time;}setInterval(showDateTime,1000);