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.
Hi Lindsay! Perhaps the information in this thread will help get you started. A tad out of my realm of expertise though :) Hopefully someone in the community will be able to chime in and assist.
I can't seem to find the sample file anymore, but I have done this with a webobject that displays a simple HTML page which in turn gets the current date and time from a Javascript.
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
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! :)
Thank you so much! This has really helped :-) do you know if there is a way to change the date so that it will spell out the month such as February 16, 2016 instead of 02/16/16?
Not my expertise and I'm not sure if Nerralie is still subscribed, but you are welcome to reach out to her directly if needed via the 'Contact Me' option on her user profile.
9 Replies
Hi Lindsay! Perhaps the information in this thread will help get you started. A tad out of my realm of expertise though :) Hopefully someone in the community will be able to chime in and assist.
I can't seem to find the sample file anymore, but I have done this with a webobject that displays a simple HTML page which in turn gets the current date and time from a Javascript.
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
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! :)
Thank you so much! This has really helped :-) do you know if there is a way to change the date so that it will spell out the month such as February 16, 2016 instead of 02/16/16?
Hi Cheryl!
Not my expertise and I'm not sure if Nerralie is still subscribed, but you are welcome to reach out to her directly if needed via the 'Contact Me' option on her user profile.
Ok thank you - I found one of Nuno's threads and it was helping - but I think I broke it in my presentation lol so I will just start it over :)
Oh no! Sorry to hear that Cheryl.
Well, keep in mind that responding to the forums via e-mail attaches your signature. You are welcome to pop in and edit if needed :)
Thank you - I had no idea it did that.
This discussion is closed. You can start a new discussion or contact Articulate Support.