PHPackages                             theoaks/relative-datetime-format-builder - 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. theoaks/relative-datetime-format-builder

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

theoaks/relative-datetime-format-builder
========================================

Object Oriented approach to building the different relative date/time formats that the strtotime(), DateTime and date\_create() parser understands.

v1.0.3(3y ago)22.2kGPL-3.0-or-laterPHPPHP ^8.1

Since Feb 3Pushed 3y agoCompare

[ Source](https://github.com/theoaks/relative-datetime-format-builder)[ Packagist](https://packagist.org/packages/theoaks/relative-datetime-format-builder)[ Docs](https://github.com/theoaks/relative-datetime-format-builder)[ RSS](/packages/theoaks-relative-datetime-format-builder/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

Relative DateTime Format Builder
================================

[](#relative-datetime-format-builder)

Object-Oriented approach to building the different relative date/time formats that the strtotime(), DateTime and date\_create() parser understands. [Check The PHP Documentation for details](https://www.php.net/manual/de/datetime.formats.relative.php)

How to install
--------------

[](#how-to-install)

Install using composer

```
composer require theoaks/relative-datetime-format-builder

```

How to use
----------

[](#how-to-use)

```
use Oaks\RelativeDatetimeFormatBuilder\RelativeDateTimeFormatBuilder;

$first_day_of_january = RelativeDateTimeFormatBuilder::firstDayOf(
            MonthName::January
        );
echo $first_day_of_january;
$date = $first_day_of_january->toDateTime();

echo $date->format("y-M-d");

/// first day of January this year
/// YYYY-01-01

$three_days_from_now = (new RelativeDateTimeFormatBuilder())->addDays(3);
echo $three_days_from_now;

$date = $three_days_from_now->toDateTime();
$date_immutable = $three_days_from_now->toDateTimeImmutable();
/// +3 day

// First day of march 2025 at 11am
$format = (new RelativeDateTimeFormatBuilder())
->firstDay()
->ofMarch()
->year(2025)
->at(hour: 11);

echo  $format;
// first day of March 2025 11:00:00
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Every ~119 days

Total

4

Last Release

1242d ago

### Community

Maintainers

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

---

Top Contributors

[![theoaksoft](https://avatars.githubusercontent.com/u/39459178?v=4)](https://github.com/theoaksoft "theoaksoft (2 commits)")

---

Tags

datetimestrtotimeFormating

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/theoaks-relative-datetime-format-builder/health.svg)

```
[![Health](https://phpackages.com/badges/theoaks-relative-datetime-format-builder/health.svg)](https://phpackages.com/packages/theoaks-relative-datetime-format-builder)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k417.9M1.7k](/packages/nette-utils)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5255.7M110](/packages/symplify-monorepo-builder)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12524.8M137](/packages/phpdocumentor-reflection)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k16.6k1](/packages/phpactor-phpactor)[sylius/promotion

Flexible promotion management for PHP applications.

28495.4k13](/packages/sylius-promotion)[sylius/money-bundle

Currencies and money formatting engine bundle for Symfony.

18670.7k22](/packages/sylius-money-bundle)

PHPackages © 2026

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