CronExpression
CRON expression parser that can determine whether or not a CRON expression is due to run, the next run date and previous run date of a CRON expression.
Description Description
The determinations made by this class are accurate if checked run once per minute (seconds are dropped from date time comparisons).
Schedule parts must map to: minute [0-59], hour [0-23], day of month, month [1-12|JAN-DEC], day of week [1-7|MON-SUN], and an optional year.
Source Source
File: packages/action-scheduler/lib/cron-expression/CronExpression.php
Methods Methods
- __construct — Parse a CRON expression
- __toString — Helper method to output the full expression.
- factory — Factory method to create a new CronExpression.
- getExpression — Get all or part of the CRON expression
- getMultipleRunDates — Get multiple run dates starting at the current date or a specific date
- getNextRunDate — Get a next run date relative to the current date or a specific date
- getPreviousRunDate — Get a previous run date relative to the current date or a specific date
- getRunDate — Get the next or previous run date of the expression relative to a date
- isDue — Determine if the cron is due to run based on the current date or a specific date. This method assumes that the current number of seconds are irrelevant, and should be called once per minute.
- setExpression — Set or change the CRON expression
- setPart — Set part of the CRON expression