Download the PHP package fovxveym69/cron-expression without Composer
On this page you can find all versions of the php package fovxveym69/cron-expression. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fovxveym69/cron-expression
More information about fovxveym69/cron-expression
Files in fovxveym69/cron-expression
Package cron-expression
Short Description Calculate the next run date a CRON expression. Support years and seconds (计算crontab表达式下一个执行日期,支持年和秒)
License MIT
Informations about the package cron-expression
cron-expression
Calculate the next run date a CRON expression. Support years and seconds (计算crontab表达式下一个执行日期,支持年和秒)
Implementation
The reference documentation for this implementation is found at https://en.wikipedia.org/wiki/Cron#CRON_expression, which I copy/pasted here (laziness!) with modifications where this implementation differs:
Field name Mandatory? Allowed values Allowed special characters
---------- ---------- -------------- --------------------------
Seconds No 0-59 * / , -
Minutes Yes 0-59 * / , -
Hours Yes 0-23 * / , -
Day of month Yes 1-31 * / , -
Month Yes 1-12 * / , -
Day of week Yes 0-6 * / , -
Year No 1970–2099 * / , -
Asterisk ( * )
The asterisk indicates that the cron expression matches for all values of the field. E.g., using an asterisk in the 4th field (month) indicates every month.
Slash ( / )
Slashes describe increments of ranges. For example 3-59/15
in the minute field indicate the third minute of the hour and every 15 minutes thereafter. The form */...
is equivalent to the form "first-last/...", that is, an increment over the largest possible range of the field.
Comma ( , )
Commas are used to separate items of a list. For example 3,4,5 in the day filed indicate the day of The 3rd, 4th and 5th of every month.
Hyphen ( - )
Hyphens define ranges. For example, 2000-2010 indicates every year between 2000 and 2010 AD, inclusive.
Installing
Add the dependency to your project:
Usage
example1
example2
example3
Requirements
- PHP 7.1+