3

I want to convert cron values to human readable format.I have cron values that have 6 positions.these are the examples..

00 01 05 * * ?
0 0/5 * * * ?

I refer this http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/ but there are errors for 6 position cron values.

$cron = Cron\CronExpression::factory('0 0 0 ? 1/2 FRI#2 *');

echo $cron->getNextRunDate()->format('Y-m-d H:i:s');

error > **Invalid CRON field value 0 at position 2**

but 5 position cron values are work properly.

How can I solve this?thanks.

niac
  • 33
  • 2
  • 17
ruwanmadhusanka
  • 851
  • 2
  • 8
  • 15

1 Answers1

0

Five option cron values:

1 minute (0-59)
2 hour (0-23)
3 day of month (1-31)
4 month (1-12)
5 day of week (0-6) 0 for sunday
6 year(optional)


* * * * * *
1 2 3 4 5 6
Aravind
  • 86
  • 7
  • yes.but this libraries doesn't work for 6 options.only work for 5 options.How can I convert 6 position cron value to human readable form? – ruwanmadhusanka Oct 25 '19 at 07:58