KScript docs
EN

cron fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

From KScript.Core

#cron->next(after?: date) → date

The next time the schedule runs, after a date or after now.
ParameterTakes
after optionaldate
Example
<let name="x" type="cron" value="'0 9 * * mon-fri'" />
<echo>{ $x->next('2026-11-21T10:00:00'->to_date()) }</echo>
$x: cron = '0 9 * * mon-fri'
echo $x->next('2026-11-21T10:00:00'->to_date())

#cron->next_times(count: int, after?: date) → list

The next few times it runs.
ParameterTakes
count requiredint
after optionaldate

Arguments can be named: ->next_times(…, after: …).

Example
<let name="x" type="cron" value="'0 9 * * mon-fri'" />
<echo>{ $x->next_times(3, '2026-11-21T10:00:00'->to_date()) }</echo>
$x: cron = '0 9 * * mon-fri'
echo $x->next_times(3, '2026-11-21T10:00:00'->to_date())

Methods from any

Methods from string