• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Bridgehill Learning Solutions

Learning Solutions. Human Connections!

  • About
  • Services
  • Testimonials
  • Portfolio
    • Client Projects (Snap Shots)
    • e-Learning Samples
  • Resources
    • Voice-Over Narrators
    • My eBooks
    • Posts & Articles
    • Micro-Lessons
    • JavaScript
  • Contact
  • About
  • Services
  • Testimonials
  • Portfolio
    • Client Projects (Snap Shots)
    • e-Learning Samples
  • Resources
    • Voice-Over Narrators
    • My eBooks
    • Posts & Articles
    • Micro-Lessons
    • JavaScript
  • Contact

Creating a Date/Time Stamp in Storyline 360

Home » elearningMatters » Creating a Date/Time Stamp in Storyline 360
January 27, 2022 by Richard

Today’s post focuses on creating a date/time stamp that will appear on a specific slide in Storyline 360. A user on the e-Learning Heroes forum had the following requirements:

  1. Add month, date, day, year to a result slide
  2. User cannot edit or change
  3. User takes screenshot to show when they completed the assessment

A JavaScript Solution

Using Javascript that was triggered when the timeline started, I produced the following result:

The Process

To create this, I performed the following steps:

  1. Created a Storyline variable named SystemDate
  2. Added this text to the slide: %SystemDate%
  3. Added the following javascript trigger to fire when the timeline started on the slide
var options = {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };
var date = 'Assessment completed on ' + new Date().toLocaleTimeString('en-us', options);
var player = GetPlayer();
player.SetVar("SystemDate",date);
Category: elearningMatters, JavaScript

About Richard

Experienced L&D Consultant | Instructional Designer | eLearning Developer | Articulate MVP/Super Hero | Author | Jazz Connoisseur

Previous Post:Making Objects Shrink on Hover – The Pupil Project
Next Post:Spinning Clocks in Storyline 360

Reader Interactions

Comments

  1. Bethany Fortenberry

    February 29, 2024 at 12:24 pm

    Is there a way to alter the javascript to not report in military time?

    Reply
    • Richard

      March 4, 2024 at 3:15 pm

      Bethany,

      Current script showing military time
      var options = {weekday: ‘long’, year: ‘numeric’, month: ‘long’, day: ‘numeric’, hour: ‘2-digit’, minute: ‘2-digit’, second: ‘2-digit’, hour12: false };
      var date = ‘Assessment completed on ‘ + new Date().toLocaleTimeString(‘en-us’, options);
      var player = GetPlayer();
      player.SetVar(“SystemDate”,date);

      //Non-military time, change hour12:flase to hour12:true as shown below
      var options = { weekday: ‘long’, year: ‘numeric’, month: ‘long’, day: ‘numeric’, hour: ‘2-digit’, minute: ‘2-digit’, second: ‘2-digit’, hour12: true };
      var date = ‘Assessment completed on ‘ + new Date().toLocaleTimeString(‘en-us’, options);
      var player = GetPlayer();
      player.SetVar(“SystemDate”,date);

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ready to start your project?

Let’s talk and see how I can help!

Work With Me