Skip to main content

CronParseTask

Return a timestamp from a crontab instruction.

Input: None

Returns: A timestamp

Example: Return the unix timestamp for the on-chain SYSCLOCK

{
"cronParseTask": {
"cronPattern": "* * * * * *",
"clockOffset": 0,
"clock": "SYSCLOCK"
}
}

Example: Return the unix timestamp for next friday at 5pm UTC

{
"cronParseTask": {
"cronPattern": "0 17 * * 5",
"clockOffset": 0,
"clock": 0
}
}


Fields

NameTypeDescription
 clock

Use the TaskRunner’s clock or the on-chain SYSCLOCK.

 clockOffset

int32

The timestamp offset to calculate the next run.

 cronPattern

string

The cron pattern to parse.

Enums

 ClockType

ValueNameDescription
 0ORACLE

Use the TaskRunners system clock for the current time.

 1SYSCLOCK

Use the on-chain SYSCLOCK for the current time.