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 1w 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 65% 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

1287d 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

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5256.1M134](/packages/symplify-monorepo-builder)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k17.9k1](/packages/phpactor-phpactor)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12526.9M157](/packages/phpdocumentor-reflection)[veewee/xml

XML without worries

1837.3M39](/packages/veewee-xml)[sylius/promotion

Flexible promotion management for PHP applications.

28515.1k15](/packages/sylius-promotion)[sylius/product

Product catalog system with support for product options and variants.

24403.3k22](/packages/sylius-product)

PHPackages © 2026

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