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 函数
基础教程推荐
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
