PHPackages                             dzonydvlp/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. [Localization &amp; i18n](/categories/localization)
4. /
5. dzonydvlp/date

ActiveLibrary[Localization &amp; i18n](/categories/localization)

dzonydvlp/date
==============

A date library to help you work with dates in different languages

12.0.3(1mo ago)00MITPHPCI passing

Since Dec 22Pushed 1mo agoCompare

[ Source](https://github.com/dzonydvlp/date)[ Packagist](https://packagist.org/packages/dzonydvlp/date)[ Docs](https://github.com/dzonydvlp/date)[ GitHub Sponsors](https://github.com/jenssegers)[ Fund](https://tidelift.com/funding/github/packagist/jenssegers/date)[ RSS](/packages/dzonydvlp-date/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Date
====

[](#date)

[![Latest Stable Version](https://camo.githubusercontent.com/a6a98fbf45f7faa55f8450e886bf1e8af9f2142e7c696af0474f1e2fe0ca0ed9/687474703a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6a656e737365676572732f646174652e737667)](https://packagist.org/packages/jenssegers/date) [![Total Downloads](https://camo.githubusercontent.com/2056ce2194ce4be4e72032e0b6b8ee5ac3ca27a914cad7989ae478a697046b27/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6a656e737365676572732f646174652e737667)](https://packagist.org/packages/jenssegers/date) [![Build Status](https://camo.githubusercontent.com/75c46cb80c39d96c809c042d5782f3e9bee3bb842262fd99fb1c0e80c8240243/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a656e737365676572732f646174652e737667)](https://travis-ci.org/jenssegers/date) [![Coverage Status](https://camo.githubusercontent.com/a48d8ea557a75e9919a6a9ecd9311ee2047eb822d785d9fb755f837d9b6b5449/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6a656e737365676572732f646174652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/jenssegers/date?branch=master) [![Donate](https://camo.githubusercontent.com/d47cdb766a100070d38a702d9c7760ccc8052063484e1478a26bcd16680d33af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d626c75652e737667)](https://www.paypal.me/jenssegers)

This date library extends [Carbon](https://github.com/briannesbitt/Carbon) with multi-language support. Methods such as `format`, `diffForHumans`, `parse`, `createFromFormat` and the new `timespan`, will now be translated based on your locale.

> All translations made by contributors have been moved to the Carbon 2 package. This package now uses the Carbon translations to provide you with better multi-language support. Translation issues should be reported on the [Carbon repository](https://github.com/briannesbitt/Carbon). Please also check out the original documentation [here](https://carbon.nesbot.com/docs).

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

[](#installation)

Install using composer:

```
composer require jenssegers/date
```

Laravel
-------

[](#laravel)

There is a service provider included for integration with the Laravel framework. This provider will get the application locale setting and use this for translations. This service will be automatically registered if you use Laravel 5.5+ using the auto-discovery. Else to register the service provider, add the following to the providers array in `config/app.php`:

```
Jenssegers\Date\DateServiceProvider::class,
```

You can also add it as a Facade in `config/app.php`:

```
'Date' => Jenssegers\Date\Date::class,
```

Languages
---------

[](#languages)

This package contains language files for the following languages ():

- Afar (aa)
- Afrikaans (af)
- Aghem (agq)
- Aguaruna (agr)
- Akan (ak)
- Amharic (am)
- Aragonese (an)
- Angika (anp)
- Arabic (ar)
- Assamese (as)
- Asu (asa)
- Asturian (ast)
- Southern Aymara (ayc)
- Azerbaijani (az)
- Basaa (bas)
- Belarusian (be)
- Bemba (bem)
- ber (ber)
- Bena (bez)
- Bulgarian (bg)
- Bhili (bhb)
- Bhojpuri (bho)
- Bislama (bi)
- Bambara (bm)
- Bengali (bn)
- Tibetan (bo)
- Breton (br)
- Bodo (brx)
- Bosnian (bs)
- Bilin (byn)
- Catalan (ca)
- Chakma (ccp)
- Chechen (ce)
- Chiga (cgg)
- Cherokee (chr)
- Chinese (cmn)
- Crimean Turkish (crh)
- Czech (cs)
- Kashubian (csb)
- Church Slavic (cu)
- Chuvash (cv)
- Welsh (cy)
- Danish (da)
- Taita (dav)
- German (de)
- Zarma (dje)
- Dogri (macrolanguage) (doi)
- Lower Sorbian (dsb)
- Duala (dua)
- Divehi (dv)
- Jola-Fonyi (dyo)
- Dzongkha (dz)
- Embu (ebu)
- Ewe (ee)
- Greek (modern) (el)
- English (en)
- Esperanto (eo)
- Spanish (es)
- Estonian (et)
- Basque (eu)
- Ewondo (ewo)
- Persian (fa)
- Fulah (ff)
- Finnish (fi)
- Filipino (fil)
- Faroese (fo)
- French (fr)
- Friulian (fur)
- Western Frisian (fy)
- Irish (ga)
- Gaelic (gd)
- Geez (gez)
- Galician (gl)
- Konkani (gom)
- Swiss German (gsw)
- Gujarati (gu)
- Gusii (guz)
- Manx (gv)
- Hausa (ha)
- Hakka Chinese (hak)
- Hawaiian (haw)
- Hebrew (modern) (he)
- Hindi (hi)
- Fiji Hindi (hif)
- Chhattisgarhi (hne)
- Croatian (hr)
- Upper Sorbian (hsb)
- Haitian (ht)
- Hungarian (hu)
- Armenian (hy)
- i18n (i18n)
- Interlingua (ia)
- Indonesian (id)
- Igbo (ig)
- Sichuan Yi (ii)
- Inupiaq (ik)
- in (in)
- Icelandic (is)
- Italian (it)
- Inuktitut (iu)
- iw (iw)
- Japanese (ja)
- Ngomba (jgo)
- Machame (jmc)
- Javanese (jv)
- Georgian (ka)
- Kabyle (kab)
- Kamba (kam)
- Makonde (kde)
- Kabuverdianu (kea)
- Koyra Chiini (khq)
- Kikuyu (ki)
- Kazakh (kk)
- Kako (kkj)
- Kalaallisut (kl)
- Kalenjin (kln)
- Central Khmer (km)
- Kannada (kn)
- Korean (ko)
- Konkani (kok)
- Kashmiri (ks)
- Shambala (ksb)
- Bafia (ksf)
- Colognian (ksh)
- Kurdish (ku)
- Cornish (kw)
- Kirghiz (ky)
- Langi (lag)
- Luxembourgish (lb)
- Ganda (lg)
- Limburgan (li)
- Ligurian (lij)
- Lakota (lkt)
- Lingala (ln)
- Lao (lo)
- Northern Luri (lrc)
- Lithuanian (lt)
- Luba-Katanga (lu)
- Luo (luo)
- Luyia (luy)
- Latvian (lv)
- Literary Chinese (lzh)
- Magahi (mag)
- Maithili (mai)
- Masai (mas)
- Meru (mer)
- Morisyen (mfe)
- Malagasy (mg)
- Makhuwa-Meetto (mgh)
- Metaʼ (mgo)
- Eastern Mari (mhr)
- Maori (mi)
- Mískito (miq)
- Karbi (mjw)
- Macedonian (mk)
- Malayalam (ml)
- Mongolian (mn)
- Manipuri (mni)
- mo (mo)
- Marathi (mr)
- Malay (ms)
- Maltese (mt)
- Mundang (mua)
- Burmese (my)
- Mazanderani (mzn)
- Min Nan Chinese (nan)
- Nama (naq)
- Norwegian Bokmål (nb)
- North Ndebele (nd)
- Low German (nds)
- Nepali (ne)
- Central Nahuatl (nhn)
- Niuean (niu)
- Dutch (nl)
- Kwasio (nmg)
- Norwegian Nynorsk (nn)
- Ngiemboon (nnh)
- Norwegian (no)
- South Ndebele (nr)
- Northern Sotho (nso)
- Nuer (nus)
- Nyankole (nyn)
- Occitan (oc)
- Oromo (om)
- Oriya (or)
- Ossetian (os)
- Panjabi (pa)
- Papiamento (pap)
- Polish (pl)
- Prussian (prg)
- Pashto (ps)
- Portuguese (pt)
- Quechua (qu)
- Cusco Quechua (quz)
- Rajasthani (raj)
- Romansh (rm)
- Rundi (rn)
- Romanian (ro)
- Rombo (rof)
- Russian (ru)
- Kinyarwanda (rw)
- Rwa (rwk)
- Sanskrit (sa)
- Sakha (sah)
- Samburu (saq)
- Santali (sat)
- Sangu (sbp)
- Sardinian (sc)
- Sindhi (sd)
- Northern Sami (se)
- Sena (seh)
- Koyraboro Senni (ses)
- Sango (sg)
- Samogitian (sgs)
- sh (sh)
- Tachelhit (shi)
- Shan (shn)
- Shuswap (shs)
- Sinhala (si)
- Sidamo (sid)
- Slovak (sk)
- Slovene (sl)
- Samoan (sm)
- Inari Sami (smn)
- Shona (sn)
- Somali (so)
- Albanian (sq)
- Serbian (sr)
- Swati (ss)
- Southern Sotho (st)
- Swedish (sv)
- Swahili (sw)
- Silesian (szl)
- Tamil (ta)
- Tulu (tcy)
- Telugu (te)
- Teso (teo)
- Tetum (tet)
- Tajik (tg)
- Thai (th)
- Chitwania Tharu (the)
- Tigrinya (ti)
- Tigre (tig)
- Turkmen (tk)
- Tagalog (tl)
- Klingon (tlh)
- Tswana (tn)
- Tongan (Tonga Islands) (to)
- Tok Pisin (tpi)
- Turkish (tr)
- Tsonga (ts)
- Tatar (tt)
- Tasawaq (twq)
- Talossan (tzl)
- Tamazight (tzm)
- Uighur (ug)
- Ukrainian (uk)
- Unami (unm)
- Urdu (ur)
- Uzbek (uz)
- Vai (vai)
- Venda (ve)
- Vietnamese (vi)
- Volapük (vo)
- Vunjo (vun)
- Walloon (wa)
- Walser (wae)
- Wolaytta (wal)
- Wolof (wo)
- Xhosa (xh)
- Soga (xog)
- Yangben (yav)
- Yiddish (yi)
- Yoruba (yo)
- Cantonese (yue)
- Yau (Morobe Province) (yuw)
- Standard Moroccan Tamazight (zgh)
- Chinese (zh)
- Zulu (zu)

Usage
-----

[](#usage)

The Date class extends the Carbon methods such as `format` and `diffForHumans`, and translates them based on your locale:

```
use Jenssegers\Date\Date;

Date::setLocale('nl');

echo Date::now()->format('l j F Y H:i:s'); // zondag 28 april 2013 21:58:16

echo Date::parse('-1 day')->diffForHumans(); // 1 dag geleden
```

The Date class also added some aliases and additional methods such as: `ago` which is an alias for `diffForHumans`, and the `timespan` method:

```
echo $date->timespan(); // 3 months, 1 week, 1 day, 3 hours, 20 minutes
```

Methods such as `parse` and `createFromFormat` also support "reverse translations". When calling these methods with translated input, it will try to translate it to English before passing it to DateTime:

```
$date = Date::createFromFormat('l d F Y', 'zaterdag 21 maart 2015');
```

Carbon
------

[](#carbon)

Carbon is the library the Date class is based on. All of the original Carbon operations are still available, check out  for more information. Here are some of the available methods:

### Creating dates

[](#creating-dates)

You can create Date objects just like the DateTime object ():

```
$date = new Date();
$date = new Date('2000-01-31');
$date = new Date('2000-01-31 12:00:00');

// With time zone
$date = new Date('2000-01-31', new DateTimeZone('Europe/Brussels'));
```

You can skip the creation of a DateTimeZone object:

```
$date = new Date('2000-01-31', 'Europe/Brussels');
```

Create Date objects from a relative format ():

```
$date = new Date('now');
$date = new Date('today');
$date = new Date('+1 hour');
$date = new Date('next monday');
```

This is also available using these static methods:

```
$date = Date::parse('now');
$date = Date::now();
```

Creating a Date from a timestamp:

```
$date = new Date(1367186296);
```

Or from an existing date or time:

```
$date = Date::createFromDate(2000, 1, 31);
$date = Date::createFromTime(12, 0, 0);
$date = Date::create(2000, 1, 31, 12, 0, 0);
```

### Formatting Dates

[](#formatting-dates)

You can format a Date object like the DateTime object ():

```
echo Date::now()->format('Y-m-d'); // 2000-01-31
```

The Date object can be cast to a string:

```
echo Date::now(); // 2000-01-31 12:00:00
```

Get a human readable output (alias for diffForHumans):

```
echo $date->ago(); // 5 days ago
```

Calculate a timespan:

```
$date = new Date('+1000 days');
echo Date::now()->timespan($date);
// 2 years, 8 months, 3 weeks, 5 days

// or even
echo Date::now()->timespan('+1000 days');
```

Get years since date:

```
$date = new Date('-10 years');
echo $date->age; // 10

$date = new Date('+10 years');
echo $date->age; // -10
```

### Manipulating Dates

[](#manipulating-dates)

You can manipulate by using the *add* and *sub* methods, with relative intervals ():

```
$yesterday = Date::now()->sub('1 day');
$tomorrow  = Date::now()->add('1 day');

// ISO 8601
$date = Date::now()->add('P2Y4DT6H8M');
```

You can access and modify all date attributes as an object:

```
$date->year = 2013:
$date->month = 1;
$date->day = 31;

$date->hour = 12;
$date->minute = 0;
$date->second = 0;
```

Contributing
------------

[](#contributing)

Language contributions should made to .

License
-------

[](#license)

Laravel Date is licensed under [The MIT License (MIT)](LICENSE).

Security contact information
----------------------------

[](#security-contact-information)

To report a security vulnerability, follow [these steps](https://tidelift.com/security).

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 74.3% 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 ~43 days

Total

3

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87535de511f99569eb74260583413822ffb4824f1d3c1365775a7780dbe5ef5c?d=identicon)[dzony.dvlp](/maintainers/dzony.dvlp)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (361 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (23 commits)")[![balping](https://avatars.githubusercontent.com/u/5840038?v=4)](https://github.com/balping "balping (8 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (5 commits)")[![dzonydvlp](https://avatars.githubusercontent.com/u/24817145?v=4)](https://github.com/dzonydvlp "dzonydvlp (5 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (5 commits)")[![urbankid](https://avatars.githubusercontent.com/u/25597?v=4)](https://github.com/urbankid "urbankid (4 commits)")[![SCIF](https://avatars.githubusercontent.com/u/671925?v=4)](https://github.com/SCIF "SCIF (4 commits)")[![thujohn](https://avatars.githubusercontent.com/u/580699?v=4)](https://github.com/thujohn "thujohn (4 commits)")[![kerryusry](https://avatars.githubusercontent.com/u/627920?v=4)](https://github.com/kerryusry "kerryusry (4 commits)")[![MartijnThomas](https://avatars.githubusercontent.com/u/3611378?v=4)](https://github.com/MartijnThomas "MartijnThomas (4 commits)")[![matthewnessworthy](https://avatars.githubusercontent.com/u/5653887?v=4)](https://github.com/matthewnessworthy "matthewnessworthy (4 commits)")[![mmestrovic](https://avatars.githubusercontent.com/u/1012878?v=4)](https://github.com/mmestrovic "mmestrovic (4 commits)")[![akalongman](https://avatars.githubusercontent.com/u/423050?v=4)](https://github.com/akalongman "akalongman (4 commits)")[![limenet](https://avatars.githubusercontent.com/u/474329?v=4)](https://github.com/limenet "limenet (3 commits)")[![meigwilym](https://avatars.githubusercontent.com/u/457719?v=4)](https://github.com/meigwilym "meigwilym (3 commits)")[![aiiro](https://avatars.githubusercontent.com/u/666616?v=4)](https://github.com/aiiro "aiiro (3 commits)")[![romanbican](https://avatars.githubusercontent.com/u/6573175?v=4)](https://github.com/romanbican "romanbican (3 commits)")[![Albert221](https://avatars.githubusercontent.com/u/4085280?v=4)](https://github.com/Albert221 "Albert221 (3 commits)")[![sineld](https://avatars.githubusercontent.com/u/445349?v=4)](https://github.com/sineld "sineld (3 commits)")

---

Tags

laraveli18ntranslationdatetimetimedatecarbon

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jenssegers/date

A date library to help you work with dates in different languages

1.8k11.2M79](/packages/jenssegers-date)[fightbulc/moment

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

9693.2M10](/packages/fightbulc-moment)[p3ym4n/jdate

Date converter from Jalali to Georgian and vice versa. It has Carbon instance inside and it's Laravel friendly.

101.8k2](/packages/p3ym4n-jdate)

PHPackages © 2026

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