Javascript for current time and dates

Hello,

I really need some help. I want to have current dates display on columns in an elearning course that is a software simulation and I need it in different formats. Does anyone know what Javascript I would need to add that would accomplish this? I would like to display date and time in the following formats:

Fri, 1 Dec 17 1334 (using a 24 hour clock and minutes)

01Dec

1 Dec 17 1334

Help would be greatly appreciated. Thank you!

11 Replies
Claire Ballantyne

Thank you so very much. I have another question about adding in a date. I wanted to add a date and time, but the time needs to be 2 hours from the current time and in this format: (4 Dec 17 1425). Do you know how I that can be done? Thank you!

Claire Ballantyne, CTDP
Education Specialist, UHN Digital Education

416-340-4800 ext. 6570
www.UHNdigital.com
[Macintosh HD:Users:lparente:AeroFS:IT3:Design:Deliverables:UHNdigital Logos:UHNdigital

Claire Ballantyne

Thank you! I haven't been out of storyboarding all day to check for your response. Thanks again

Claire Ballantyne, CTDP
Education Specialist, UHN Digital Education

416-340-4800 ext. 6570
www.UHNdigital.com
[Macintosh HD:Users:lparente:AeroFS:IT3:Design:Deliverables:UHNdigital Logos:UHNdigital

Lindsay Martin

Has anyone experienced glitches with their date/time variables? I have a project (same as Claire's above) with numerous date/time variables and it works sometimes so I believe the javascript/triggers/variables are accurate. However, they stop working sometimes.. seemingly random, but wondering if the community has any advice. A few pieces of additional info: 

-the storyline project file is really large with a lot of project variables.. could that be effecting it?

-the variables were previously numbered (ie. Date1, Date2, etc) and SL seemed to be renaming them to higher numbers, so we switched to letters (ie. DateA, DateB, etc) but no luck

-this is tested and posted on a website so it is not the previously mentioned viewing problem

I can't attach the full project for proprietary reasons, but here are the variables, an example slide of trigger, and the javascript. 

Thank you in advance!