Forum Discussion
How to insert current date variable into a "customised certificate slide".
Hi Mitzi, follow the steps below and you should be able to show the date
- Create a text variable called 'SystemDate'
- Create a text box for reference to the variable 'SystemDate'
- Add a trigger - execute Javascript when timeline starts the certificate looking slide
- Copy and paste the code below in the Script coloumn
var m_names = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December");
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth();
var yyyy = today.getFullYear();
if(dd<10) { dd='0'+dd }
var date= m_names[mm]+' '+dd+', '+yyyy;
var player = GetPlayer();
player.SetVar("SystemDate",date);
- VickieSublette5 years agoCommunity Member
Do you know how to make it appear in date/month/year format? For example, 12 September 2020
- NatalieBowman3 months agoCommunity Member
Hi, this worked for me.
var m_names = new Array(" January", " February", " March",
" April", " May", " June", " July", " August", " September",
" October", " November", " December");
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth();
var yyyy = today.getFullYear();
if(dd<10) { dd='0'+dd }
var date= ' '+dd+m_names[mm]+', '+yyyy;
var player = GetPlayer();
player.SetVar("SystemDate",date);