schedule()

This function allows you to define a crontab entry in parameter a-f. In parameter g, you can define a starting time. Starting from the starting time, it is then calculated when the next start would be triggered by the crontab entry. The return value of the function is a timestamp. Note: The crontab entry here is only used within the function and is only used for the calculation. It does not trigger any event. The timestamp return value, however, allows you to implement your own timed events in the mapping.

Parameters


Parameter

Description

a

Second. See section "Crontab syntax".

b

Minute.

c

Hour.

d

Day month.

e

Month.

f

Weekday.

g

Starting time in milliseconds. See also function milliseconds().

Example


Let's start with the following function chain.

milliseconds(a)
a Wert: 2019-01-11 03:03:00
 
schedule(a,b,c,d,e,f,g)
a Wert: 0
b Wert: */15
c Wert: *
d Wert: *
e Wert: *
f Wert: *
g Ergebnis: 1


First we generate the millisecond value of a timestamp (the last start time). In the second function we define a crontab entry in parameters a-f that would start every 15 minutes. In parameter g we then use the calculated millisecond value.

As result we get "2019-03-11 03:15:00.0".

You can now use this value relative to the current time to determine if you want to trigger an (arbitrary) event. So if the returned timestamp is in the past, you trigger your event.


milliseconds(a)
a Wert: 2019-01-11 03:03:00
 
schedule(a,b,c,d,e,f,g)
a Wert: 0
b Wert: */15
c Wert: *
d Wert: *
e Wert: *
f Wert: *
g Ergebnis: 1
 
now()
 
a < b
a Ergebnis: 2
b Ergebnis: 3


The result is "true". Note: An implicit type conversion into millisecond values takes place in the time comparison, which makes it possible to numerically compare the two times. See section Datatypes.