Returns a boolean indicating whether the cron daemon is currently running.
Removes a previously registered callback function for the specified event.
The name of the event to remove the callback function from.
The callback function to remove.
Registers a callback function to be executed every time the specified event is emitted.
The name of the event to listen for.
The callback function to execute when the event is emitted.
Registers a callback function to be executed only once when the specified event is emitted.
The name of the event to listen for.
The callback function to execute when the event is emitted.
Determines whether the given crontab expression matches the given date and time.
The crontab expression to check.
The date and time to check against the crontab expression.
Parses the given cron expression and returns either a DateTime
object representing the next time the cron expression will match, or a CronTabObject
containing the parsed cron expression.
The cron expression to parse.
Optional
now: DateTimeThe current date and time to use as a reference when calculating the next match time. If not provided, the current date and time will be used.
DateTime
object representing the next time the cron expression will match, or a CronTabObject
containing the parsed cron expression.now
parameter is not a valid DateTime
object.Static
crontabCheck if the crontab expression matches the current time
A crontab expression, crontab alias or unix timestamp
A DateTime object representing the current time
If the crontab expression matches the current time
Static
getParses the given cron expression and returns either a DateTime
object representing the next time the cron expression will match, or a CronTabObject
containing the parsed cron expression.
The cron expression to parse.
Optional
now: DateTimeThe current date and time to use as a reference when calculating the next match time. If not provided, the current date and time will be used.
DateTime
object representing the next time the cron expression will match, or a CronTabObject
containing the parsed cron expression.now
parameter is not a valid DateTime
object.
A simple Cron Daemon which supports a resolution of up to 10ms.