System Time
Nov 12, 2015
By
Avni Vyas
To create a clock within Storyline 2 I created a var called SystemTime and set the following JavaScript to launch when the timeline starts
var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10)
minutes = "0" + minutes
var suffix = "AM";
if (hours >= 12) {
suffix = "PM";
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
var timeString=hours + ":" + minutes + " " + suffix
var player = GetPlayer();
player.SetVar("SystemTime",timeString);
It seems to work! Useful if you need a clock displayed with the actual time on it.
2 Replies
THIS IS WONDERFUL thank you avni!
Avni, this is very helpful. Thank you!
This discussion is closed. You can start a new discussion or contact Articulate Support.