### Install via Composer Source: https://github.com/dragonmantank/cron-expression/blob/master/README.md Add the dragonmantank/cron-expression library to your PHP project using Composer. This command fetches and installs the latest stable version. ```bash composer require dragonmantank/cron-expression ``` -------------------------------- ### Cron Expression Example Source: https://github.com/dragonmantank/cron-expression/blob/master/README.md Demonstrates a specific cron expression syntax for scheduling tasks on the last Sunday of every month. ```cron * * * * 7L ``` -------------------------------- ### Basic Cron Expression Usage Source: https://github.com/dragonmantank/cron-expression/blob/master/README.md Demonstrates how to instantiate the CronExpression parser with predefined schedules like '@daily' and calculate the next and previous run dates. It also shows parsing complex cron strings. ```php isDue(); echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s'); // Works with complex expressions $cron = new Cron\CronExpression('3-59/15 6-12 */15 1 2-5'); echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); // Calculate a run date two iterations into the future $cron = new Cron\CronExpression('@daily'); echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s'); // Calculate a run date relative to a specific time $cron = new Cron\CronExpression('@monthly'); echo $cron->getNextRunDate('2010-01-12 00:00:00')->format('Y-m-d H:i:s'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.