Fórum Fórum

Voltar

RE: Using the clock instead of just a timer

Alternar
Using the clock instead of just a timer
Resposta
10/12/20 13:03
Is there a possibility of linking a lesson to the actual time / clock rather than just the timer? I'd like to have to have the lesson or a trigger start at a pre-determined time and correspondingly, end at a certain time based on real world time.
0 (0 Votos)

RE: Using the clock instead of just a timer
procedure date-time
Resposta
10/12/20 17:30 em resposta a Rupert Picardo.
Hi Rupert,

Yes, this is possible to do using one of SmartBuilder's Advanced > Procedure blocks. Here's how: https://www.screencast.com/t/7Ss3Fl0e

Rob
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
10/12/20 18:58 em resposta a Rob Penn.
This is pretty cool, Rob.  I just tried it out but am not able to get it to work, though.  
Do I have it set up correctly?  
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
10/12/20 19:35 em resposta a Scott Sheridan.
Hi Scott,

The format you're using for the registered function is "MM/DD/YYY:hh:mm:ss" but you then compare that to "13:52 on 10-12-2020" which is "hh:mm on mm-dd-yyy" format, so this comparison will never be true. To make it work, change the first parameter in the registered function to "hh:mm on mm-dd-yyyy". 
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
10/12/20 19:46 em resposta a Rob Penn.
Ahhh! Got it.  
Thanks!  
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
19/12/20 06:52 em resposta a Rob Penn.
As a follow up to this question - is there a way of linking the time to say GMT or any international standard time?
Rather than a system time, I’d like to actually have say a lesson that is only active from say, 5:00pm GMT till 6:00pm GMT - irrespective of where you are in the world.

Any inputs on how I can achieve that?
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
21/12/20 21:04 em resposta a Rupert Picardo.
Hi Rupert,
This is possible. You can use Javascript to get the UTC time. However, keep in mind that this is still using the operating system's clock - which means if the learner adjusts their computer's clock, they can get around it. To make it really work so that a learner could not access the course, you would have to have a server somewhere (something that the learner cannot change) that the lesson could talk to to confirm the actual time.

If you're interested in using Javascript to get the UTC time, here's how to do that:
Video: https://share.smartbuilder.com/public/support/get-UTC-time-make-course-available.mp4
Sample lesson: https://share.smartbuilder.com/public/support/get-UTC-time-make-course-available.sb4

Hope that helps!
0 (0 Votos)

RE: Using the clock instead of just a timer
Resposta
01/01/21 10:43 em resposta a Navdeep Dhillon.
That's awesome. Thanks again, guys. You really rock
0 (0 Votos)