GetTimedEvent

Evaluates a configured timer for its next execution time

Description

GetTimedEvent( timerno, from=now, &command=0, &index=0, &param=0, &value=0 )

Evaluates a timer's cron-like syntax, and calculates the next time it will match.

Parameters

timerno Timer number in configuration
from Timestamp to start the search from (defaults to current time)
commmand If supplied, this parameter will be set to the command from the timer config
index If supplied, this parameter will be set to the index from the timer config
param If supplied, this parameter will be set to the param from the timer config
value If supplied, this parameter will be set to the value from the timer config

Return value

The EPOCH time of the next time the timer pattern will match.

Example usage

 
    new x, cmd;
 
    // Assuming the timer is " * * * 5 10-20 * ", so matching minutes 10-20 at 5am every day
    // Also assuming current time is 05:00
 
    x = GetTimedEvent( 1, _, cmd, _, _, _ );
 
    // x is 600 seconds bigger than current EPOCH time.
    // cmd is set to the timer's ACTION parameter