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.
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!
We just need the date in UK format, so day/month/year.
Thanks
Raj
Hi Raj,
You may need to tweak the last line of the script to get the format you’re looking for.
Paste into javascript “before body end tag”
<script>
var months = t'January','February','March','April','May','June','July',
'August','September','October','November','December'];
var today = new Date();
today.setTime(today.getTime());
document.getElementById("spanDate").innerHTML = monthsmtoday.getMonth()] + " " + today.getDate()+ ", " + today.getFullYear();
</script>
Paste into custom HTML container
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.
I got this to work pretty easily - but how can I control the font size and color of the date?
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.
Hey there people.
Stefano workaround still works. Although is missing a couple steps.
Step 1 option A- Create a text element on the builder and make sure to save their ID. Find the ID here
Step 1 option B- Create a custom HTML element and make sure to add an ID to the element.
but the font size and color are not changing for me appropriately. When I update the font color and style nothing happens. The default font stays the same.
Is there a way to always show 7PM Monday 14th June for example and then every monday same time every week?
Hello! We can dynamically update the date on our pages for desktop (and adjust the font etc) but we cannot display this correctly on mobile. Any suggestions here?
What happens for us is: The date is called using javascript+html but if we try to duplicate the code box for mobile, nothing displays.