PHPackages                             lezhnev/time-scheduler - 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. lezhnev/time-scheduler

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

lezhnev/time-scheduler
======================

Time scheduler is a class to schedule timeslots by given time table

1.0.0(10y ago)129MITPHPPHP &gt;=5.4

Since Jan 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lezhnev74/TimeScheduler)[ Packagist](https://packagist.org/packages/lezhnev/time-scheduler)[ RSS](/packages/lezhnev-time-scheduler/feed)WikiDiscussions master Synced 1mo ago

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

TimeScheduler
=============

[](#timescheduler)

![Travis](https://camo.githubusercontent.com/fa699e8dc8d75c6ab6e138a015f58e0aef859e121b3a151a99423412f39ee2ff/68747470733a2f2f7472617669732d63692e6f72672f6c657a686e657637342f54696d655363686564756c65722e7376673f6272616e63683d6d6173746572)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/36f829ce1665a5db4ecca9b910c174fff11beed8f008767054bafd238f9ac396/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c657a686e657637342f54696d655363686564756c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lezhnev74/TimeScheduler/?branch=master)![Packagist](https://camo.githubusercontent.com/991cee327b6cdc79de74d550db9885c5180837acb6c901520b16736b8c79a010/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c657a686e65762f74696d652d7363686564756c65722e737667)

Class allows you to set weekdays and time stamps and pick next available for scheduling purposes.

Installation
------------

[](#installation)

Just run composer:

```
composer require lezhnev/time-scheduler

```

Example
-------

[](#example)

```
use TimeScheduler\Classes\TimeScheduler;

$scheduler = new TimeScheduler();

//if required set the last slot, so next one will be calculated from this time point
$now = strtotime("next Monday 12:00");
$scheduler->setLastTimeslot($now);

// set Time table
$scheduler->setScheduleTimeSlots(
    [
        "Mon" => ["12:30", "12:40"],
        "Tue" => [],
        "Wed" => [],
        "Thu" => ["21:30"],
        "Fri" => [],
        "Sat" => [],
        "Sun" => [],
    ]
);

// iteratively call getNextTimeSlot() to get next slot from time table
$time1 = $scheduler->getNextTimeSlot();
$time2 = $scheduler->getNextTimeSlot();

date("H:i",$time1); // will be "12:30"
date("H:i",$time2); // will be "12:40"
```

Support
-------

[](#support)

Please feel free to add PR or email me at

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

3770d ago

### Community

Maintainers

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

---

Top Contributors

[![lezhnev74](https://avatars.githubusercontent.com/u/10206110?v=4)](https://github.com/lezhnev74 "lezhnev74 (25 commits)")

---

Tags

timescheduletimetable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lezhnev-time-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/lezhnev-time-scheduler/health.svg)](https://phpackages.com/packages/lezhnev-time-scheduler)
```

###  Alternatives

[dragonmantank/cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

4.7k474.1M484](/packages/dragonmantank-cron-expression)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[symfony/clock

Decouples applications from the system clock

430168.9M205](/packages/symfony-clock)[spatie/opening-hours

A helper to query and format a set of opening hours

1.7k5.3M30](/packages/spatie-opening-hours)[florianv/business

DateTime calculations in business hours

359775.9k1](/packages/florianv-business)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6308.9M39](/packages/knplabs-knp-time-bundle)

PHPackages © 2026

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