Java date issues
Nov 28, 2014
Hi folks, help really appreciated with this. I have inserted a variable to pick up the system date and I've executed the following java script - note the date is in British format, when it was in American format it worked, now it doesn't? why? I am not a java user, I don't do coding, I'm not a technical person so an answer in laymans terms would be most appreciated. Incidentally the only way I can get the date to pull in is if I use the html5 link - which then stops my lovely Print widget from working? is this something I will just have to put up with?
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString= day + " " + theMonth + " " + year
var player = GetPlayer();
player.SetVar("SystemDate",dateString);
Thank you in advance folks.
6 Replies
I have sorted this now, thank you!
Thanks for the update Helena, glad that you were able to get this sorted. If it's something that you think would benefit others in the community, feel free to share :)
Hello, I actually want to do the same thing but don't know how to start. Could you explain the steps of how to accomplish this?
Hello Stephanie and welcome to E-Learning Heroes :)
This thread is a bit dated and I'm not sure that Helena is still subscribed here. We have some documentation here on JavaScript best practices if you'd like to take a look. Otherwise, hopefully someone in the community will be able to chime in and assist you here.
Thank you very much. The video tutorial in the example was great and exactly what I needed. I use Storyline 2 and it worked perfectly.
Stephanie Martel
Training Compliance Specialist
Triumvirate Environmental
Sounds great Stephanie - glad that was able to assist you.
I just wanted to mention that replying to the forums via e-mail attaches your signature. You are welcome to pop in and edit if needed.
This discussion is closed. You can start a new discussion or contact Articulate Support.