PHP code example of darthsteven / cron-expression-hash

1. Go to this page and download the library: Download darthsteven/cron-expression-hash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

darthsteven / cron-expression-hash example snippets




rks with predefined scheduling definitions.
$cron = HashCron\HashCronExpression::hashFactory('@daily', 'abc');
$cron->isDue();
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');
echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s');

// Works with literal H characters.
$cron = HashCron\HashCronExpression::hashFactory('H H * * H', 'def');
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');