PHPackages                             phppkg/hucron - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phppkg/hucron

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phppkg/hucron
=============

Express crontabs as human readable phrases

1.0.0(4y ago)4653↓100%MITPHPCI passing

Since Sep 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/phppkg/hucron)[ Packagist](https://packagist.org/packages/phppkg/hucron)[ Docs](https://github.com/phppkg/hucron)[ RSS](/packages/phppkg-hucron/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

HuCron
======

[](#hucron)

[![GitHub tag (latest SemVer)](https://camo.githubusercontent.com/08849365e59e2c97df96e69fe6b3c5c6c35cd30cf68ccc859a3f1a02c482dea8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f706870706b672f687563726f6e)](https://github.com/phppkg/hucron)[![Github Actions Status](https://github.com/phppkg/hucron/workflows/Unit-tests/badge.svg)](https://github.com/phppkg/hucron/actions)[![Php Version](https://camo.githubusercontent.com/7803ee9cf1349959d0c72b473a420cafa752a2fd550d5a8b8722803850354c62/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345372e322e302d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/phppkg/hucron)[![License](https://camo.githubusercontent.com/d1484fc4e0d5bbf88a47f0de0f721a2aabb9b4f2f74131a98df6c84114a28c28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706870706b672f687563726f6e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

`HuCron` turns human readable strings about time and turns them into valid crontabs.

> `phppkg/hucron` is froked from the

Install
-------

[](#install)

```
composer install phppkg/hucron
```

Usage
-----

[](#usage)

There are some examples for parse human statement.

### Shortcuts statement

[](#shortcuts-statement)

```
use HuCron\HuCron;

echo HuCron::fromStatement('@hourly'); // "0 * * * *"

echo HuCron::fromStatement('@daliy'); // "0 0 * * *"

echo HuCron::fromStatement('@weekly'); // "0 0 * * 0"

echo HuCron::fromStatement('@monthly'); // "0 0 1 * *"

// echo HuCron::fromStatement('@yearly');
echo HuCron::fromStatement('@annually'); // "0 0 1 1 *"
```

### Custom statement

[](#custom-statement)

```
use HuCron\HuCron;

echo HuCron::fromStatement('Every day at midnight');
// "0 0 * * *"

echo HuCron::fromStatement('Every 15 minutes at midnight on the weekend');
// "*/15 0 * * 0,6"

echo HuCron::fromStatement('Every other minute in August at noon on a weekday');
// "*/2 12 * 8 1,2,3,4,5"

echo HuCron::fromStatement('The 1st day in April at midnight');
// "0 0 1 4 *"

echo HuCron::fromStatement('Every day on the weekday at 2:25pm');
// "25 14 * * 1,2,3,4,5"
```

Syntax
------

[](#syntax)

`HuCron` identifies the parts of a string with specific time-related keywords such as "on, to, at" and uses this to deduce the time meaning and convert it into part of a cron tab. It's not particular about the order of these statements. Here's a brief list of things that it will pick up and parse into a crontab:

- Periods (`daily, weekly, monthly`)
- Exact times (`9:30 PM, 8a, 3p`)
- Meridiems (`AM/PM/A/P`)
- Intervals (`1st, second, other, ninth, etc`)
- Specific fields (`second, minute, hour, day, month`)
- Day of week (`sunday, monday` etc)
- 12 o'clocks (`noon, midnight`)
- Lists (e.g. `5 to 12 minutes`)
- Month names (`january, february`, etc)
- Weekend / weekday

What's a cron tab?
------------------

[](#whats-a-cron-tab)

A cron tab is an expression that defines a recurring period of time.

It looks something like this:

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

```

From [Wikipedia](https://en.wikipedia.org/wiki/Cron):

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like connecting to the Internet and downloading email at regular intervals.

Related
-------

[](#related)

-  Calculate the next or previous run date and determine
-  Makes CRON expressions human-readable

LICENSE
-------

[](#license)

[MIT](LICENSE)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1684d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d23e1decaf354e8f36a7ad61128865dc78dd63336c2d023d79aa3ff8ba2a05ff?d=identicon)[inhere](/maintainers/inhere)

---

Top Contributors

[![ajbdev](https://avatars.githubusercontent.com/u/572055?v=4)](https://github.com/ajbdev "ajbdev (21 commits)")[![inhere](https://avatars.githubusercontent.com/u/5302062?v=4)](https://github.com/inhere "inhere (17 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phppkg-hucron/health.svg)

```
[![Health](https://phpackages.com/badges/phppkg-hucron/health.svg)](https://phpackages.com/packages/phppkg-hucron)
```

###  Alternatives

[scheb/tombstone

Dead code detection with tombstones for PHP

282578.2k2](/packages/scheb-tombstone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
