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

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

repat/date-constants
====================

A series of constants designed to make it easier to express dates in PHP applications

2.0.1(7y ago)222.4k↓34.6%1MITPHP

Since Mar 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/repat/date-constants)[ Packagist](https://packagist.org/packages/repat/date-constants)[ RSS](/packages/repat-date-constants/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (6)Used By (1)

Date Constants
==============

[](#date-constants)

[![Build Status](https://camo.githubusercontent.com/9f2a43c7be5dab745659daf6879727b86d6316aa6be622c77617ac6b2d7bdaa8/68747470733a2f2f7472617669732d63692e6f72672f72657061742f646174652d636f6e7374616e74732e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/repat/date-constants)[![Packagist](https://camo.githubusercontent.com/08e73ba88edbe24ca8609098ccf363297f1e706638d949d4584ee7a59f710c20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657061742f646174652d636f6e7374616e74732e737667)](https://packagist.org/packages/repat/date-constants)

The **Date Constants** package defines a number of useful PHP constants within your application, making it easier to express measures of dates.

These constants may seem familiar to Laravel developers, as they're absolutely [inspired by Nesbot\\Carbons use of date constants](https://carbon.nesbot.com/docs/#api-constants). Also, shoutout to the [`stevegrunwell/time-constants`](https://github.com/stevegrunwell/time-constants) package for the idea.

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

[](#installation)

Date Constants is intended to be installed via Composer:

```
$ composer require repat/date-constants
```

The package has been configured to automatically expose the `constants.php` file via the Composer-generated autoloader, so you'll be ready to use the constants as soon as the package has been installed!

Defined constants
-----------------

[](#defined-constants)

This is a list of all constants defined by this package, along with their values. Each constant is wrapped in a `if (! defined(...))` conditional, ensuring these constants can easily be redefined if necessary and won't conflict with existing constants.

### From Carbon

[](#from-carbon)

- `YEARS_PER_CENTURY` (100)
- `YEARS_PER_DECADE` (10)
- `MONTHS_PER_YEAR` (12)
- `WEEKS_PER_YEAR` (52)
- `DAYS_PER_WEEK` (7)
- `HOURS_PER_DAY` (24)

#### Days of the week

[](#days-of-the-week)

- `SUNDAY` (0)
- `MONDAY` (1)
- `TUESDAY` (2)
- `WEDNESDAY` (3)
- `THURSDAY` (4)
- `FRIDAY` (5)
- `SATURDAY` (6)

### Misc

[](#misc)

- `DAYS_PER_YEAR` (365)
- `DAYS_PER_LEAP_YEAR` (366)
- `DAYS_PER_FORTNIGHT` (14)

### Months

[](#months)

- `JANUARY` (1)
- `FEBRUARY` (2)
- `MARCH` (3)
- `APRIL` (4)
- `MAY` (5)
- `JUNE` (6)
- `JULY` (7)
- `AUGUST` (8)
- `SEPTEMBER` (9)
- `OCTOBER` (19)
- `NOVEMBER` (11)
- `DECEMBER` (12)

#### Amount of days

[](#amount-of-days)

- `DAYS_JAN` (31)
- `DAYS_FEB` (28)
- `DAYS_FEB_LEAP` (29)
- `DAYS_MAR` (31)
- `DAYS_APR` (30)
- `DAYS_JUN` (31)
- `DAYS_JUL` (30)
- `DAYS_AUG` (31)
- `DAYS_SEP` (30)
- `DAYS_OCT` (31)
- `DAYS_NOV` (30)
- `DAYS_DEC` (31)

TODO
----

[](#todo)

- Finish Tests

Version
-------

[](#version)

- Version 2.0.1

Contact
-------

[](#contact)

#### repat

[](#repat)

- Homepage:
- e-mail:
- Twitter: [@repat123](https://twitter.com/repat123 "repat123 on twitter")

[![Flattr this git repo](https://camo.githubusercontent.com/7e3f46a36526479d701ef7f90a0f8c3ac2fbab3087446e2a9fceed75cd1ab802/687474703a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=repat&url=https://github.com/repat/date-constants&title=date-constants&language=&tags=github&category=software)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 89.7% 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 ~131 days

Total

4

Last Release

2587d ago

Major Versions

v1.1.0 → 2.0.02019-04-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/405dab243007488e7e7851422e5864a9312aee36058d60f1e6d623232c4d3131?d=identicon)[repat](/maintainers/repat)

---

Top Contributors

[![stevegrunwell](https://avatars.githubusercontent.com/u/233836?v=4)](https://github.com/stevegrunwell "stevegrunwell (26 commits)")[![repat](https://avatars.githubusercontent.com/u/516807?v=4)](https://github.com/repat "repat (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

PHPackages © 2026

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