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

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

arokettu/date
=============

Date class for PHP (without time)

2.5.0(4mo ago)02.3k↓25%8MITPHPPHP ^8.2

Since Feb 27Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/arokettu/php-date)[ Packagist](https://packagist.org/packages/arokettu/date)[ Docs](https://sandfox.dev/php/date.html)[ RSS](/packages/arokettu-date/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (11)Used By (8)

Date
====

[](#date)

[![PHP](https://camo.githubusercontent.com/6c0b2ea7c00d4e37a4c3f38717c1821dfc6fd8e8fc922858144cfb29279e1310/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61726f6b657474752f646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arokettu/date)[![License](https://camo.githubusercontent.com/211870c653cf9eb24ce8ecb6548b7aeada73ee65f61c7c824ee5c0bfcd7df175/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61726f6b657474752f646174652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitLab CI](https://camo.githubusercontent.com/44f8265aba828f712d42977f4ea3a63913301ee5e7e6dde57b7048144e488628/68747470733a2f2f696d672e736869656c64732e696f2f6769746c61622f706970656c696e652f73616e64666f782f7068702d646174652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://gitlab.com/sandfox/php-date/-/pipelines)[![Codecov](https://camo.githubusercontent.com/4bcc1e34b99e1af21e20532ad43385673b4b95437269b844f2cbdd43c0b913a2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f676c2f73616e64666f782f7068702d646174653f7374796c653d666c61742d737175617265)](https://codecov.io/gl/sandfox/php-date/)

A class for php to work with pure dates (without time).

- Works with the proleptic [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar) by default
- Uses [Julian day](https://en.wikipedia.org/wiki/Julian_day) internally
- Does not depend on the calendar extension
- Correctly supports full integer range for the dates (-5884323-05-15 to 5874898-06-03 on a 32-bit system, even more on 64-bit)
- Additional calendars:
    - [ISO week date](https://en.wikipedia.org/wiki/ISO_week_date)
    - [Julian](https://en.wikipedia.org/wiki/Julian_calendar)
    - [Revised Julian (Milanković)](https://en.wikipedia.org/wiki/Revised_Julian_calendar)

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

[](#installation)

```
composer require arokettu/date
```

Usage
-----

[](#usage)

The library:

```
