Giter VIP home page Giter VIP logo

cron-expression's Introduction

PHP Cron Expression Parser

Latest Stable Version Total Downloads Tests StyleCI

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

The parser can handle increments of ranges (e.g. */12, 2-59/3), intervals (e.g. 0-9), lists (e.g. 1,2,3), W to find the nearest weekday for a given day of the month, L to find the last day of the month, L to find the last given weekday of a month, and hash (#) to find the nth weekday of a given month.

More information about this fork can be found in the blog post here. tl;dr - v2.0.0 is a major breaking change, and @dragonmantank can better take care of the project in a separate fork.

Installing

Add the dependency to your project:

composer require dragonmantank/cron-expression

Usage

<?php

require_once '/vendor/autoload.php';

// Works with predefined scheduling definitions
$cron = new Cron\CronExpression('@daily');
$cron->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');

CRON Expressions

A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows:

*    *    *    *    *
-    -    -    -    -
|    |    |    |    |
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    +---------- month (1 - 12)
|    |    +--------------- day of month (1 - 31)
|    +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)

This library also supports a few macros:

  • @yearly, @annually - Run once a year, midnight, Jan. 1 - 0 0 1 1 *
  • @monthly - Run once a month, midnight, first of month - 0 0 1 * *
  • @weekly - Run once a week, midnight on Sun - 0 0 * * 0
  • @daily, @midnight - Run once a day, midnight - 0 0 * * *
  • @hourly - Run once an hour, first minute - 0 * * * *

Requirements

  • PHP 7.2+
  • PHPUnit is required to run the unit tests
  • Composer is required to run the unit tests

Projects that Use cron-expression

cron-expression's People

Contributors

aensley avatar atefbb avatar ausi avatar chentsulin avatar chris53897 avatar cmorbitzer avatar derekcresswell avatar dragonmantank avatar dragooon avatar eimantasmorkunas avatar fabpot avatar fruitl00p avatar grahamcampbell avatar holtkamp avatar imyip avatar laurencei avatar lucasmichot avatar mtdowling avatar oallain avatar pablokowalczyk avatar peter279k avatar phansys avatar piotr-cz avatar pstast avatar rgson avatar rvanlaarhoven avatar timwolla avatar tqmz avatar tucksaun avatar tvlooy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cron-expression's Issues

Allows negative range

Please correct me if i am wrong but i guess 5-1 * * * * should not be an valid expression

Issue with parsing `/` on Minute and Hour field

It fails to parse / in minute or hour field when you are trying to step the value from a minute or hour field but works when used with range value or *. Following code snippet shows the issue.

$c = Cron\CronExpression::factory ('5/2 * * * *')
// InvalidArgumentException with message 'Invalid CRON field value 5/2 at position 0'
$c = Cron\CronExpression::factory ('5-10/2 * * * *') // Success

$c = Cron\CronExpression::factory ('* 2/3 ? * *')
// InvalidArgumentException with message 'Invalid CRON field value 2/3 at position 1'
$c = Cron\CronExpression::factory ('* */3 ? * *') // Success

Human Readable cron String

FEATURE request:

It would be nice to have a method to translate cron string to a human readable format, like prettyCron js library (http://azza-bazoo.github.io/prettycron/). So for example:

Cron expression: 0 * * * *
Human readable: Every hour, on the hour

Cron expression: 30 * * * 1
Human readable: Every 30th minute past every hour on Mon

Cron expression: 15,45 9,21 * * *
Human readable: 09:15, 09:45, 21:15 and 21:45 every day

Cron expression: 18,19 7 5 * *
Human readable: 07:18 and 07:19 on the 5th of every month

Cron expression: * * 25 12 *
Human readable: Every minute on the 25th in Dec

Cron expression: 0 * 1,3 * *
Human readable: Every hour, on the hour on the 1 and 3rd of every month

Cron expression: 0 17 * 1,4,7,10 *
Human readable: 17:00 every day in Jan, Apr, Jul and Oct

Cron for every X amount of hours is returning interesting results.

Hello,

While utilizing this library, I'm trying to work on an interface that allows a user to interface a specific interval for a cron task to run. I've potentially discovered this issue where the next run date appears to not be changing after 2 hours.

I am not sure if it is an actual issue with the library, or if there's some kind of rule I am forgetting about cron intervals itself.

Code Sample:

\Cron\CronExpression::factory("0 */1 * * *")->getNextRunDate()->getTimestamp()

Example output when incrementing the hour:
image

Could I please get some help?

Thanks,
Ely Haughie

PHP 8.0 compatibility

Are there any plans for adding compatibilty with PHP 8.0?

Would you like me to create a pull request for this?

Bug: "0-59/59 10 * * *" skips 10:00

@dragonmantank

cron schedule: 0-59/59 10 * * *

$times = [];
$now = new Carbon();

$cron = CronExpression::factory("0-59/59 10 * * *");
for ($k = 0 ; $k < 20; $k++){
	$times[] = $cron->getNextRunDate($now, $k);
}

There is a bug. 2020-08-20 10:00:00 is missed. The first time is 2020-08-20 10:59:00

Wrong result for minute with getPreviousRunDate()

Results for the minute-level are wrong, I think.

It's 23:10:05.

The expression * * * * * with getPreviousRunDate()->format('H:i:s') should give 23:10:00 as result. But it gives 23:09:00.

Same with */2 * * * * ==> 23:08:00

which macros etc

It is great that your project supports cron macros like @daily. But which ones are supported?

Seems like this should be covered in the readme.

Also I read your blog post, and it seems reasonable that you refer to the right place in cronie that your cron expression logic is now sourced from.

If you agree that this welcome, I can submit a pull request with this "real soon now".

-FT

Multiple "Day if Month" values including "L" for Last Day of Month

I love this library. I'm using it to run billing on varying schedules.

I just ran into a situation where one customer needs an invoice generated from the 1st of the month through the 15th of the month, and from the 15th of the month through the last day of the month. So invoice generation needs to run at the end of the day (for them this is 6:00 PM PST) on the 15 and the last day of the month. My schedule looks like this:

0 18 L,15 * *

Unfortunately, it does not look like the "day of the month" supports multiple comma-separated days including "L" for the last day, the way it does numeric days.

If this is a desired feature, I'm happy to try and tackle it.

Does v1.2.x still have full PHP 5.3+ support?

Just updating my composer.json from mtdowling/cron-expression to dragonmantank/cron-expression, and I wanted to double check that v1.2.x is still fully compatible with PHP 5.3+ (specifically v1.2.1 and anything that may happen in the future, though I realize there probably won't be any more updates).

Basically, if I have "dragonmantank/cron-expression": "v1.2.*" in my json will I ever have to worry about not being compatible with PHP 5.3?

Class constants should not use 'public'

Hi:

I received a syntax error while running the extension:

Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /data1/pt/dev/zhaopengju/app/os_loan/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php on line 29

The source code is as follows:

class CronExpression
{
public const MINUTE = 0;
public const HOUR = 1;
public const DAY = 2;
public const MONTH = 3;
public const WEEKDAY = 4;
public const YEAR = 5;
...

}

Class constants should not use access modifiers ?

hope to get your reply

Feature Request : Implement Iterator interface

This class seems to be a good fit for the Iterator interface, possibly the SeekableIterator interface. This would remove (or make redundant) the getPreviousRunDate and getNextRunDate methods, making the object easier to work with in a foreach context or other contexts where iterating through the datetime matches of the expression.

When it comes down to it, this class is really a special form of the existing DatePeriod class, but accepting a cron expression instead of an ISO-8601 date interval expression, right? Should this be modeled more closely to that class (and the DateInterval class)?

Ambigous class resolutions problems

Ok - so I've run into an issue.

Scenario:

  • My users want to use my Package A which uses the new dragonmantank/cron-expression v2.
  • My users also have other packages, perhaps Package B, which still uses the old mtdowling/cron-expression v1.

This is a big problem. Composer will happily install both versions - because as far as it is concern they are two different packages.

But the problem is they both have the same namespace of Cron. So you end up with a composer update with errors like this:

image

So from digging around some composer forums - I dont think there is a solution, other than changing the namespace of this package - perhaps to CronExpression\Cron or Dragonmantank\Cron. Obviously this is a breaking change, and you'd need to bump to v3.

However, this is going to lead to another problem later, where if Package C is using v2 and Package D is using v3 - then they are now incompatible and composer wont let you install them.

My current solution is I need to fork this library, and republish it under my own namespace (which I really dont want to have to do).

I dont see a way around it?

Value 00 is treated as invalid

Hello,
in new versions, literal '00' as part of cron expression is now treated as invalid. This was not the case in previous versions.
It's probably due to php filter behaviour, where in AbstractField.php, line 261:
filter_var($value, FILTER_VALIDATE_INT) returns false for '00' but returns 0 for '0'.

The same applies for other strings like '05' etc,

Thanks for cheking that, Jakub

Incorrect expression

0 0 12 1 1/2 ? *

At 12:00 PM, on day 1 of the month, every 2 months

Error:
Fatal error: Uncaught InvalidArgumentException: 6 is not a valid position

Wrong result from "0 0 1/1 * *"

Cron expression: 0 0 1/1 * *
Reference date: 2020-02-26 11:37:35

With v2.3.0, the getNextRunDate method return 2020-03-01 00:00:00 but the right value is 2020-02-27 00:00:00.

But with master branch, getNextRunDate throw a exception: InvalidArgumentException : Invalid CRON field value 1/1 at position 2.

I have check my cron expression with crontab.guru and this expression is valid: https://crontab.guru/#0_0_1/1__

Why this expression throw a exception or return a wrong result ?

Symfony bundle

Hi

And thanks for a great library. I couldn't find any well tested/up to date libraries integrating your library into Symfony, so I created one: CronExpressionBundle if you want to link to it somewhere in your docs.

Anyways, thanks!

Valid cron expression is not accepted

Input

$expression = '2,17,35,47 5-7,11-13 * * *';

Expected behaviour

  • CronExpression::isValidExpression($expression) returns true
  • CronExpression::factory($expression) returns a CronExpression instance.

Referring to crontab.guru this is a valid expression.

Actual behaviour

  • CronExpression::isValidExpression($expression) returns false
  • CronExpression::factory($expression) throws an InvalidArgumentException with message Invalid CRON field value 5-7,11-13 at position 1

Identified cause

Range and list at the same time in the same field are not accepted.

See https://github.com/dragonmantank/cron-expression/blob/v2.0.0/src/Cron/AbstractField.php#L210


I would like to provide a PR, if you confirm this is a valid issue.

I once implemented a cron expression validator myself, which allows this expression. I updated it today to be compatible with the PHPUnit 6+ version.

Multiple steps not allow

It may be nothing but I thought you could include multiple step list items
Though not entirely useful in the below example it is still valid but fails the ->validate() function:
*/2,1-4/2 (past every 2nd hour and every 2nd hour from 1 through 4)
on any field but you can't

I think its still valid syntax that could be solved by moving the evaluation of each list item just below the early exit '*' but above the evaluation of the dash "/" in the validation function.

Let me know if I am not correct

Cron runs every minute if minute is 0

I have this issue:

$test = Cron\CronExpression::factory('@daily');
$test->setPart(0, 0);
$test->setPart(1, 15);
$test->isDue(); // Returns true for every minute between 15 and 16

It seems like this is caused by the isSatisfiedBy() method in the MinutesField class

if ($value == '?') { // <== Should this be testing for type equality, or am I missing something?
  return true;
}

It seems like the value 0 is loosely equal to any string in php.

If I am missing something, then maybe we should also check for a numeric value?

getNextRunDate

hi Mtdowling,

i'm using getMultipleRunDates to extimate crontab next run during a month.
i setup CronExpression in this way:

$cron = Cron\CronExpression::factory('* * * * 1');

then i tried, just for test, to read next 30 crontab execution with this script part:

$row["next_run"] = $cron->getNextRunDate()->format('Y-m-d H:i:s');
$row["next_run_lst"] = [];
$aRUNs = $cron->getMultipleRunDates(30, date("Y-m-01 00:00:00"), false, true);
foreach($aRUNs as $aRUN_key => $aRUN){
$row["next_run_lst"][] = $aRUN;
}

The result is:

Array
(
[next_run] => 2019-09-09 00:00:00
[next_run_lst] => Array
(
[0] => 2019-09-02 00:00:00
[1] => 2019-09-02 00:01:00
[2] => 2019-09-02 00:02:00
...

if i modify initial setup with $cron = Cron\CronExpression::factory('0 0 * * 1'); the result is OK.

Array
(
[next_run] => 2019-09-09 00:00:00
[next_run_lst] => Array
(
[0] => 2019-09-02 00:00:00
[1] => 2019-09-09 00:00:00
[2] => 2019-09-16 00:00:00
...

i think there is something wrong with CronExpression.php -> getRunDate at line 380. It seams it would increment always minutes.

Backport v3 bugfixes with minor version update in v2

Due to the breaking change Laravel will not bump to v3 in laravel 6 and 7. Bugfixes could be backported on a separate v2 branch

#Fixed#

  • Fixed infinite loop when determining last day of week from literals
  • Fixed bug where single number ranges were allowed (ex: 1/10)
  • Fixed nullable FieldFactory in CronExpression where no factory could be supplied
  • Fixed issue where logic for dropping seconds to 0 could lead to a timezone change

range(): step exceeds the specified range

@dragonmantank
I'm using v2 of library:

$now = new Carbon();
$cron = CronExpression::factory("41-59/24 5 * * 5");
for ($k = 0 ; $k < 20; $k++){
	$t = $cron->getNextRunDate($now, $k);
	$times[] = $t; // Store next 20 values
}
		

Error:

range(): step exceeds the specified range

/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:148
/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:53
/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php:31
/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php:362
/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php:199

Year part deprecated, but no change found?

I am checking whether an update to 2.0.0 is viable.

The changelog mentions that the (optional) YEAR part is not supported anymore.

But in the commit history I can not find any changes about this:

mtdowling/cron-expression@master...dragonmantank:master

Only that testing this part os removed:

mtdowling@4dddfd8#diff-52eebaaed9cd0bd25017f3ed3ec3b672

Also I can still find reference to this "YEAR" part:


private static $order = array(self::YEAR, self::MONTH, self::DAY, self::WEEKDAY, self::HOUR, self::MINUTE);

I am wondering: can CRON expressions that DO have this YEAR part still be parsed by this library as of 2.0.0?

PHP8 incompatibility

PHP 8.0.0alpha1

TypeError: range(): Argument #3 ($step) must be of type int|float, string given
/var/www/intranet/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:155
/var/www/intranet/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:61
/var/www/intranet/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php:101
/var/www/intranet/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php:395
/var/www/intranet/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php:249
/var/www/intranet/src/Utils/CronExpression.php:122
/var/www/intranet/tests/Utils/CronExpressionTest.php:60

https://github.com/dragonmantank/cron-expression/blob/master/src/Cron/AbstractField.php#L155

Add (int) cast before $step is temporary solution :)

Example in README should show arguments with `isDue()` and README API documentation.

Initially I didn't know that isDue() could take parameters, so I made the mistake of calling it multiple times between potentially long running tasks, therefore offsetting the time because the function internally creates a new DateTime() object whenever it is called.

Because the README provides a "Usage" section and I was not using a code completion tool in my editor, I assumed that the entire API was demonstrated in the example. I later looked in the code to read the API and realised that there was more to it and that it was documented.

So I believe that either: The API should be fully documented in the README or the README should demonstrate the use of the isDue() parameters and the README should inform users of where to look for API documentation in the code.

Provide a 'break to parts' function

I find myself with the use case of needing to get the individual parts of an expression.

Using getExpression to get a single part is a little poor choice if you ask me (as it name doesn't immediately seem like you can get a part), but I won't complain.

I propose a simple function titled getParts or perhaps breakToParts which returns an array of all the individual parts. Happy to provide the PR if this would be accepted.

Throw Exception on non-standard expression x/y

I've been using mtdowling/cron-expression with expressions like 1/10 * * * * to run processes every 10th minute with 1 minute offset (hh:01, hh:11, hh:21, hh:32, hh:41, hh:51).

Afer switching to this library, expression has been evaluated as due only once per hour at hh:01.

I fixed the problem by changing expression to 1-59/10 * * * * however as there were no reports in error log, I had to debug whole application before finding out the cause of why data are not available.

It would be much easier to debug if this library would throw an exception on non standard expression to avoid false positives.

In this specific case, probably AbstractField::validate should throw an exception when there is range and step present and range is not in format (x-y).:

if (strpos($value, '/') !== false) {
    list($range, $step) = explode('/', $value);

    // Don't allow numeric ranges
    if (is_numeric($range)) {
        return false;
    }

    return $this->validate($range) && filter_var($step, FILTER_VALIDATE_INT);
}

For reference, when testing 1/10 * * * * in crontab.guru expression is evaluated as “At every 10th minute from 1 through 59.”, but there is a warning below: Non standard! May not work with every cron.

or/and bug

I use the library in a script that monitors cronjobs. Now we have the issue that crond handle the expression in another way than the library predicted.

The expression is: 30 0 1 * 1

Crond run on every monday and on every 1th of the month. Crond use OR. The library use AND. So the library thinks cron would only run when the 1th of the month is a monday.

Is it intentional that the library behaves like this or is it a bug?

How to get the last execution time for minutely crons?

For a cron expression of * * * * *, I would like to find out in a script whether a task has to be run or not.

Given a current time of $now (in this example it is 2019-03-08 09:15:20.598988) I expect the following:

  • $expression->getNextRunDate($now) should equal 2019-03-08 09:16:00.000000
  • $expression->getPreviousRunDate($now) should equal 2019-03-08 09:15:00.000000

But the current version of your library returns this:

  • $expression->getNextRunDate($now) correctly returns 2019-03-08 09:16:00.000000
  • $expression->getPreviousRunDate($now) incorrectly returns 2019-03-08 09:14:00.000000

Note the one minute difference in the second query.

Is there any intention behind that glitch? Is there any other way to get the actual previous run date?

Invalid data validated as valid

For example:

$monthField = new MonthField();
var_dump($monthField->validate('*/123'));

Month field: */123 is invalid, but $monthField->validate return true.
The same situation with other fields. Actually you can get an error only when using CronExpression's getNextRunDate method - "Step cannot be greater than total range" .

And why this code cause an exception?

$cron = CronExpression::factory('* * * */12 *');
$cron->getNextRunDate();

// Throws an ErrorException: "range(): step exceeds the specified range"

Cannot run example code. Exception.

When I try to run the example code in the readme:

// Works with complex expressions
$cron = Cron\CronExpression::factory('3-59/15 2,6-12 */15 1 2-5');
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');`

I get the following error:

Message: Invalid CRON field value 2,6-12 at position 1
File: /vendor\/dragonmantank\/cron-expression\/src\/Cron\/CronExpression.php
Line: 154

Release 2.3.1 and 3.0.2 with PHP 8 Support

Needed for Laravel. I am happy to do all the work for this. If you could just spin off a 2.3 branch from the 2.3.0 tag, I can send a PR to prepare 2.3.1. After that, I can deal with 3.0.2 too.

how to repeat every 2 week on Wed, Thu, Fri

I tried something like,

    $now = DateTime::createFromFormat('Y-m-d H:i:s', "2019-02-13 22:00:00");
    $min = $now->format('i');
    $hour = $now->format('H');
    $cronExpression = "$min $hour 13/14 * 3-5";

but it seems skilled some days, how to repeat every 2 week on specify weekday/weekend like google calendar?
cron on google calendar

Convert Quartz cron expressions

Hello,
would it be possible to convert quartz cron strings such as "0 19 14 * * ? *" into this project implementation ? If I try manual conversions with "19 14 * * ?" I have "Invalid CRON field value ? at position 4" error. Comments in code says that 'Day of week field. Allows: * / , - ? L #', is it really what it's done ?

I'm using the library through Laravel scheduling feature and it would be not very convenient fo rme to fork the library if I want to stay compatible with future releases.

Can't parse week days

This is a valid setting:

30 7 * * Mon

But, an exception is thrown:

Uncaught InvalidArgumentException, code 0: Invalid CRON field value Mon at position 4
Cron/CronExpression.php on line 154
#0 Cron/CronExpression.php(136): Cron\CronExpression->setPart(4, 'Mon')
#1 Cron/CronExpression.php(115): Cron\CronExpression->setExpression('30 7 * * Mon ')
#2 Cron/CronExpression.php(84): Cron\CronExpression->__construct('30 7 * * Mon ', Object(Cron\FieldFactory))

Feature, make cron time human readable

I came here trough the gist code of @m4tthumphrey , code to make cron expression human readable as string.

`$schedule = CronSchedule::fromCronString('30 01 01 * *');

echo $schedule->asNaturalLanguage();

// At 01:30 on the 1st of every month.`

Now I find this package very interesting to use, but I don't think there is an function to output the expression as human readable text, instead of converting to an specific "next date".

I open this issue, in the hope that your willing to add this feature.

InvalidArgumentException : Invalid CRON field value

If I trying to parse example from readme file, I got Invalid argument exception.
I've used PHP 7.1

// Works with complex expressions
$cron = Cron\CronExpression::factory('3-59/15 2,6-12 */15 1 2-5');
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');

Result:

InvalidArgumentException : Invalid CRON field value 2,6-12 at position 1

Support for `?` in Day of Week and Day of Month

As per the documentation of class DayOfWeekField and DayOfMonthField, it allows ? but it looks like there is no code to support the character. Due to this, following cron expression results in exception.

$cron = Cron\CronExpression::factory('0 12 * * ? *');
$cron = Cron\CronExpression::factory('0 12 ? * * *');

Error Stacktrace

Fatal error: Uncaught InvalidArgumentException: Invalid CRON field value ? at position 4 in /Users/user/aws-cron-expression/src/Cron/CronExpression.php:162
Stack trace:
#0 /Users/user/aws-cron-expression/src/Cron/CronExpression.php(143): Cron\CronExpression->setPart(4, '?')
#1 /Users/user/aws-cron-expression/src/Cron/CronExpression.php(121): Cron\CronExpression->setExpression('0 12 * * ? ')
#2 /Users/user/aws-cron-expression/src/Cron/CronExpression.php(89): Cron\CronExpression->__construct('0 12 * * ? ', Object(Cron\FieldFactory))
#3 /Users/user/aws-cron-expression/index.php(8): Cron\CronExpression::factory('0 12 * * ? ')
#4 {main}

Do you plan to implement this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.