Display date on landing page text


#1

Hello,

I require a date stamp to be visible on my landing page text. What is the java script code, is it placed before body or head etc… and how do I pull the date reference onto the page.

I have been pointed to this page https://www.w3schools.com/js/js_dates.asp but have no idea how to put it into action.

Would really be thankful for your help.

Thanks
Raj


#2

Hi there!

What kind of format would you like? We’ve used this before on customer pages and it’s really simple to set up.

Do you need the date & time, or simply the time?

Let me know and I’ll shoot you over some instructions!


#3

We just need the date in UK format, so day/month/year.

Thanks
Raj


#4

Hi Raj,

You may need to tweak the last line of the script to get the format you’re looking for.

  1. Paste into javascript “before body end tag”

<script> var months = ['January','February','March','April','May','June','July', 'August','September','October','November','December']; var today = new Date(); today.setTime(today.getTime()); document.getElementById("spanDate").innerHTML = months[today.getMonth()] + " " + today.getDate()+ ", " + today.getFullYear(); </script>

  1. Paste into custom HTML container

#5

I got unbounce to do it, they did. I will email you a collection of some
email lead generation campaigns lets see how we can work together.


#6

I got this to work pretty easily - but how can I control the font size and color of the date?


#7

The custom HTML container code from Stefano’s solution is now blank; I can only assume that means the method he was using is deprecated?

I’m having the same issue - I have the JS to generate today’s date but I can’t seem to figure out how to call it from within a custom html container since JS can no longer be placed directly within them. So, I place the JS within the Script Manager & use placement ‘Before Close Body Tag’ - but then what?

Any suggestions/help would be greatly appreciated - I didn’t want to start a new thread as there are already several on this issue.