How to Insert Current Local Time?

Nov 19, 2015

I want to insert the current time into a Storyline interaction. Has anyone found a way to do this? Maybe a web object from world time or another URL? The issue is that I want to be able to format the time so that it fits within my slide. 

Thank you, 
Lindsay 

9 Replies
Nerralie Shaw

Hi Lindsay

We learnt how to do this the other day, my understanding is that you need create a variable called SystemDate with the as "text"

On the slide you want the variable to appear you enter %SytemDate%. You then create a trigger called "execute Java Script" you enter the following script which makes the date appear.

var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString=day + "/" + month + "/" + year
var player = GetPlayer();
player.SetVar("SystemDate",dateString);

Timeline: when the timeline starts

Object: should be javascript.

Hope this helps, there are apparently many more ways you can do this

Christie Pollick

Hi, Lindsay -- I see you are new to the community, so welcome! In case you weren't aware, I thought I'd stop in to note that JS/modifications to your published output mentioned by others would not something we'd be able to provide support for, but you may want to check out this info sheet on JS Best Practices. Best of luck with your project! :)

This discussion is closed. You can start a new discussion or contact Articulate Support.