Forum Discussion
VanessaWylie
9 years agoCommunity Member
How to insert current date variable into a "customised certificate slide".
Hi there,
I have created a certificate looking slide at the end of my course. I have added in variables for the learners name, their score achieved, I am just missing the date variable to be popul...
JohnBlum
8 years agoCommunity Member
Hi Ashley,
Thank you for the additional info. Very helpful! I had published -- the problem was a typo.
I edited the JavaScript as follows so I could extract the current year which we need for a new corporate standard.
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString=month + "/" + day + "/" + year
var player = GetPlayer();
player.SetVar("SystemDate",dateString);
player.SetVar("month",month);
player.SetVar("day",day);
player.SetVar("year",year);
Thank you,
John