Java 'System Date' code not working in LMS

I used the Java script below to add a system date to the screen.  It works fine outside of the LMS, but when run via the LMS it doesn't work...it just shows the variable test 'system date' and not the actual date like it should.  Any ideas?

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);

5 Replies