Linked Questions

Popular Questions

Dynamic HTML Display Current date

Asked by At

I have a quick question.. I am using website builder called 'clickfunnels', and they dont support feature that would allow me to display current date via website. But, I can add custom html to it...

With that said, I found an old Stack Overflow question which is very close to fixing my problem, but this person wanted the current date to show +1 or the next day than the current date.

Here is the coding I tried, which works perfect on the website, I just need it to show the current date and not +1.

Can anyone please give me some tips on editing this? It would be greatly appreciated!!! Thank You!

<span id="spanDate"></span>
 <script type="text/javascript">
           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();
</script>

Related Questions