PHPackages                             siniliote-twig/date-extra - 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. [Templating &amp; Views](/categories/templating)
4. /
5. siniliote-twig/date-extra

ActiveLibrary[Templating &amp; Views](/categories/templating)

siniliote-twig/date-extra
=========================

A Twig extension to transform time diff in human readable

v3.4.0(3y ago)03.4kMITPHPPHP &gt;=7.1.3

Since Jun 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Siniliote/date-extra)[ Packagist](https://packagist.org/packages/siniliote-twig/date-extra)[ Docs](https://twig.symfony.com)[ RSS](/packages/siniliote-twig-date-extra/feed)WikiDiscussions master Synced 1mo ago

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

Twig Date Extension
===================

[](#twig-date-extension)

The *Date* extension provides the `time_diff` filter.

`time_diff`
-----------

[](#time_diff)

Use the `time_diff` filter to render the difference between a date and now.

```
{{ post.published_at|time_diff }}
```

The example above will output a string like `4 seconds ago` or `in 1 month`, depending on the filtered date.

Arguments
---------

[](#arguments)

- `date`: The date for calculate the difference from now. Can be a string or a DateTime instance.
- `now`: The date that should be used as now. Can be a string or a DateTime instance. Do not set this argument to use current date.

Translation
-----------

[](#translation)

To get a translatable output, give a `Symfony\Contracts\Translation\TranslatorInterface`as constructor argument. The returned string is formatted as `diff.ago.XXX`or `diff.in.XXX` where `XXX` can be any valid unit: second, minute, hour, day, month, year.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

1410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6148271158dbd4e4324d228ee7fe7ef1f694105be5165c1b48c501409eed8c84?d=identicon)[Siniliote](/maintainers/Siniliote)

---

Top Contributors

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

---

Tags

twigdatehuman-readable

### Embed Badge

![Health badge](/badges/siniliote-twig-date-extra/health.svg)

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

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M313](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36663.2M218](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

21946.0M132](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M53](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21814.8M161](/packages/symfony-ux-twig-component)

PHPackages © 2026

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