PHPackages                             papimod/date - 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. papimod/date

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

papimod/date
============

Module Papi

v2.1.1(4mo ago)05Apache-2.0PHPPHP &gt;=8.3.0

Since Dec 17Pushed 4mo agoCompare

[ Source](https://github.com/4uruanna/papimod-date)[ Packagist](https://packagist.org/packages/papimod/date)[ RSS](/packages/papimod-date/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Date Papi Module
================

[](#date-papi-module)

[![](https://camo.githubusercontent.com/4893040bcf8e285d2895bb07a0985e48a3ddc545ff0abdeb11622706315de0f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e352d3737374242343f6c6f676f3d706870)](https://camo.githubusercontent.com/4893040bcf8e285d2895bb07a0985e48a3ddc545ff0abdeb11622706315de0f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e352d3737374242343f6c6f676f3d706870)[![](https://camo.githubusercontent.com/1a63c4971998a5b902b01583c76051a8ee8deec80235c1f6c8b5bd8e78725680/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d322d3838353633303f6c6f676f3d636f6d706f736572)](https://camo.githubusercontent.com/1a63c4971998a5b902b01583c76051a8ee8deec80235c1f6c8b5bd8e78725680/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d322d3838353633303f6c6f676f3d636f6d706f736572)

Description
-----------

[](#description)

Help defining the API [date format](https://www.php.net/manual/en/datetime.format.php) with [time zone](https://www.php.net/manual/en/timezones.php) in your [papi](https://github.com/4uruanna/papi).

Also provide a `DateService` class to convert dates.

Prerequisites Modules
---------------------

[](#prerequisites-modules)

- [Papimod/Dotenv](https://github.com/4uruanna/papimod-dotenv)

Configuration
-------------

[](#configuration)

### `DATE_FORMAT` (.ENV)

[](#date_format-env)

RequiredNoTypestringDescriptionGlobal date formatDefault`Y-m-d`### `DATE_TIME_FORMAT` (.ENV)

[](#date_time_format-env)

RequiredNoTypestringDescriptionGlobal time formatDefault`H:i:s`### `DATE_TIMEZONE` (.ENV)

[](#date_timezone-env)

RequiredNoTypestringDescriptionGlobal timezoneDefault`Europe/Paris`Definitions
-----------

[](#definitions)

- [(service) DateService](./source/DateService.php)

Usage
-----

[](#usage)

You can add the following options to your `.env` file:

```
DATE_FORMAT="Y-m-d"
DATE_TIME_FORMAT="H:i:s"
DATE_TIMEZONE="Europe/Paris"

```

Import the module when creating your application:

```
require __DIR__ . "/../vendor/autoload.php";

use Papi\PapiBuilder;
use Papimod\Dotenv\DotEnvModule;
use Papimod\Date\DateModule;
use function DI\create;

$builder = new PapiBuilder();

$builder->setModule(
        DotEnvModule::class,
        DateModule::class
    )
    ->build()
    ->run();
```

Use the dedicated service anywhere:

```
final class MyService
{
    public function __construct(public readonly DateService $date_service)
    {
    }

    public getNow(): string
    {
        $now = new DateTime();
        return $this->date_service->format($now);
    }
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance74

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Every ~5 days

Total

3

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22fd4dcec379ce472b56c0f51528fa61ce156e5063756abcce648361770fc839?d=identicon)[4uruanna](/maintainers/4uruanna)

---

Top Contributors

[![4uruanna](https://avatars.githubusercontent.com/u/179627698?v=4)](https://github.com/4uruanna "4uruanna (19 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/papimod-date/health.svg)

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

###  Alternatives

[fastd/swoole

FastD swoole.

7529.0k3](/packages/fastd-swoole)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

961.8k](/packages/zidbih-laravel-deadlock)

PHPackages © 2026

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