PHPackages                             max13/faker-dateinterval - 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. max13/faker-dateinterval

ActiveLibrary

max13/faker-dateinterval
========================

Date and Time Interval faker provider

v1.2.0(3y ago)010MITPHPPHP ^7.0 || ^8.0

Since Aug 10Pushed 3y ago1 watchersCompare

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

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

DateInterval FakerPHP provider
==============================

[](#dateinterval-fakerphp-provider)

This is a `DateInterval` [FakerPHP](https://fakerphp.github.io) Provider. It can generate a `DateInterval` with only a *date* interval, only a *time* interval or both. It can return a `DateInterval` or a duration in the [ISO8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) format.

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

[](#installation)

You can use composer: `composer require max13/faker-dateinterval`

Usage
-----

[](#usage)

Using the examples above:

```
$faker = new Faker\Generator;
// Add this provider to Faker
$faker->addProvider(new FakerDateInterval\FakerProvider($faker));

// Generate a date, time or date and time interval
$date = $faker->dateInterval(/* $complex = */false, /* $asIso8601 = */ false);
$time = $faker->timeInterval(/* $complex = */false, /* $asIso8601 = */ false);
$datetime = $faker->dateTimeInterval(/* $complex = */false, /* $asIso8601 = */ false);
// return DateInterval objects

// You can generate a complex interval with more than 1 part generated
$date = $faker->dateInterval(/* $complex = */true, /* $asIso8601 = */ false);

// You can also retrieve the interval as an ISO8601 duration string
$date = $faker->dateInterval(/* $complex = */true, /* $asIso8601 = */ true);
// returns a string like: P1M3D for 1 month and 3 days
```

Bonus
-----

[](#bonus)

A `Laravel` service provider is included and will autoload the `FakerProvider` to faker, if `Laravel`'s service provider discovery is enabled (default).

Need help?
----------

[](#need-help)

Open an issue.

Now have fun.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~0 days

Total

3

Last Release

1368d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

fakerdateintervalfakerphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/max13-faker-dateinterval/health.svg)

```
[![Health](https://phpackages.com/badges/max13-faker-dateinterval/health.svg)](https://phpackages.com/packages/max13-faker-dateinterval)
```

###  Alternatives

[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78311.9M97](/packages/zenstruck-foundry)[mbezhanov/faker-provider-collection

A collection of custom providers for the Faker library

2138.6M24](/packages/mbezhanov-faker-provider-collection)[league/factory-muffin-faker

The goal of this package is to wrap faker to make it super easy to use with factory muffin.

4411.3M27](/packages/league-factory-muffin-faker)[pestphp/pest-plugin-faker

The Pest Faker Plugin

376.4M206](/packages/pestphp-pest-plugin-faker)[beyondcode/laravel-masked-db-dump

Dump masked information from your database

11341.2k](/packages/beyondcode-laravel-masked-db-dump)

PHPackages © 2026

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