Skip to content

returns true/false for a crontab string matched to a timestamp

License

Notifications You must be signed in to change notification settings

MichaelSekora/Cronphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Cronphp

Takes two arguments: a crontab-string and a unix-timestamp.
If the crontab-string matches the timestamp it will return "true", otherwise "false".
Syntax and behaviour follows the classic implementation on linux (vixie-cron).

INSTALLATION

include the class in your php-code

include_once "class_Cronphp.php";

USAGE

<?php
include_once "class_Cronphp.php";
$example_cronstring = "*/4 16-17 * * 5";
$example_timestamp = 1651247570;
echo "\n".date("Y-m-d H:i:s", $example_timestamp)."\n";
////////////////////
echo (Cronphp::getmatch($example_cronstring, $example_timestamp)) ? ("match") : ("no match");
////////////////////
echo "\n";
?>

About

returns true/false for a crontab string matched to a timestamp

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages