PHP function that receive a cron string and return the next run timestamp(接收 cron 字符串并返回下一次运行时间戳的 PHP 函数)
问题描述
我需要开发一个任务系统,它应该能够在不支持 crontab 的服务器上工作.
I need to develop a task system that should be able to work on servers that doesn't support crontab.
我问是否有任何现有代码可以使用 cron 字符串(例如,'0 0,12 1 */2 *' 并返回下一次计划运行的时间戳.
I'm asking if there is any existing code that can take a cron string (e.g. '0 0,12 1 */2 *' and return the timestamp of the next scheduled run.
如果找不到这样的代码,那我应该如何开始呢?
If such a code couldn't be found then how should I start with that?
推荐答案
你可以使用这个类 PHP-Parse-cron-strings-and-compute-schedules
它还会计算上次计划的运行
It'll also compute the last scheduled run
这篇关于接收 cron 字符串并返回下一次运行时间戳的 PHP 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:接收 cron 字符串并返回下一次运行时间戳的 PHP 函数


基础教程推荐
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- 将变量从树枝传递给 js 2022-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- php中的foreach复选框POST 2021-01-01
- php中的PDF导出 2022-01-01