This is setup on CodePen and is written with JavaScriptand HTML. How can I correct the code so that there is just one dateTime var and it shows today's calendar date? https://codepen.io/Artomic/pen/LYLXWpb
const currentDate = new Date();
const dateTime = currentDate.getDate() + "/" +
(currentDate.getMonth() + 1) + "/" +
currentDate.getFullYear() + " " +
currentDate.getHours() + ":" +
currentDate.getMinutes()
var months = ['January','February','March','April','May','June','July',
'August','September','October','November','December'];
var tomorrow = new Date();
tomorrow.setTime(tomorrow.getTime() + (1000*3600*24));
document.getElementById("spanDate").innerHTML = months[tomorrow.getMonth()] + " " +
tomorrow.getDate()+ ", " + tomorrow.getFullYear();
const dateTimeB = new Date().toLocaleTimeString('en-US', {
hour12: false,
hour: "numeric",
minute: "numeric"
});
console.log(dateTimeB)
document.getElementById("dateTimeB").innerHTML=dateTimeB
HTML
<span id="spanDate"></span>
<br>
<span id= "dateTimeB"</span>
<span id="dateTime"></span>