Hello everyone,
I have made a basic guide on how to use the clock component.
Here, I will explain all the blocks associated to the clock component and a few sample projects which use the clock.
1.DESIGNER PROPERTIES OF THE CLOCK
1.1Timer Always Fires
This is a Boolean property, i.e it accepts only true or false.
If you wish the clock to run even if the application is not the active screen, i.e the user is using some other application.
- Can this be set using blocks? Yes!
- Default: True
Possible uses:
- To run a timed game
- While the user is giving a quiz
1.2 Timer Enabled
This is a Boolean property, i.e it accepts only true or false.
When you want the clock to run it’s timer, then you have to set it to true.
- Can this be set using blocks? Yes!
- By default: True
Note: If the property is set to true in the designer, then the clock will automatically fire as soon as the screen initializes.
1.3 Timer Interval
This property accepts a number.
With this property we can specify the interval (in milliseconds) between each time the click.timer event is called.
- Can this be set using blocks? Yes!
- By default: 1000 milliseconds (1 second)

Note: The clock starts to leg when the interval is set to a very small value such as 10 milliseconds.
2.BLOCKS
2.1 EVENTS
There is only 1 event for this component that is the .timer event.
This is called every time the timer interval is completed.
Note: After executing all the blocks in the event is when the next interval begins. That is why a lag can be produced. Also have a look at a test done by @ScottFromScott
Example usage –

2.2 METHODS
2.2.1 “Add”
This method is used to add the amount of time specified to the given instance of time.
Under the add method, we can add the following quantities.
- Days
Result:
How to use this blocks and why does the clock1.now return 18598 days, will be explained later in the guide. For now, it is important to notice that when we added 1 to the days, it worked!
-
Year
Result:
-
Month
Result:
-
Weeks
Result:
-
Hours
Result:
-
Minutes
Result:
-
Seconds
Result:
I had to use a variable as 2 Do It’s in a second isn’t possible
-
Duration:
Here duration accepts milliseconds, so using 5000 milliseconds resulted in 5 seconds being added.
2.2.2 Get day of the month.
This is a simple method and just returns the day of the month in the given instance.
Accepts: instant
Returns: Number
Usage:
2.2.3 Duration
With the help of this block, we can get the duration between two instances in milliseconds.
Accepts: two instants (start and end)
Returns: the milliseconds by which end follows start (negative if end is earlier)
2.2.4 Duration to…
The Duration to blocks can process milliseconds to the amount of the time mentioned on them.
They can accept milliseconds and give an output of s


















