PHPackages                             trickeyone/epoch - 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. trickeyone/epoch

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

trickeyone/epoch
================

A general-purpose library to parse, validate, manipulate, and format dates

1.1.1(2y ago)0790↓50%MITPHPPHP ^8.1

Since Oct 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/trickeyone/epoch)[ Packagist](https://packagist.org/packages/trickeyone/epoch)[ RSS](/packages/trickeyone-epoch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Epoch
=====

[](#epoch)

[![PHPUnit](https://github.com/trickeyone/epoch/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/trickeyone/epoch/actions/workflows/unit-tests.yml)[![code coverage badge](https://raw.githubusercontent.com/trickeyone/epoch/gh-images/coverage.svg)](https://raw.githubusercontent.com/trickeyone/epoch/gh-images/coverage.svg)[![Test Coverage](https://camo.githubusercontent.com/fd99b554cacebbc594c1d57b47dfe95a43c9bb2171371e3986d759a92804935b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f747269636b65796f6e652f65706f63682f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/trickeyone/epoch/coverage)[![Code Climate](https://camo.githubusercontent.com/4c927d2a2597e1275a745b2de98f1b5468f071c36ceddf98e7aebca18cb3e108/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f747269636b65796f6e652f65706f63682f6261646765732f6770612e737667)](https://codeclimate.com/github/trickeyone/epoch)

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

[](#installation)

```
$ composer require trickeyone/epoch
```

Usage
-----

[](#usage)

- [Creation](docs/creation/01-creation.md)
    - [Now](docs/creation/01-creation.md#now)
    - [Create from `DateTimeInterface`](docs/creation/01-creation.md#datetimeinterface)
    - [String + Format](docs/creation/01-creation.md#strings)
    - [Unix Timestamp](docs/creation/01-creation.md#unix-timestamp)
    - [Create from year, month, day, etc.](docs/creation/03-specific-values.md)
    - [Cloning](docs/creation/01-creation.md#cloning)
- [Get/Set](docs/01-get-set.md)
    - [Microseconds](docs/01-get-set.md#microseconds)
    - [Milliseconds](docs/01-get-set.md#milliseconds)
    - [Seconds](docs/01-get-set.md#seconds)
    - [Minutes](docs/01-get-set.md#minutes)
    - [Hours](docs/01-get-set.md#hours)
    - [Day of the Month](docs/01-get-set.md#day-of-the-month)
    - [Day of the Week](docs/01-get-set.md#day-of-the-week)
    - [ISO Day of the Week](docs/01-get-set.md#iso-day-of-the-week)
    - [Day of the Year](docs/01-get-set.md#day-of-the-year)
    - [Week of the Year](docs/01-get-set.md#week-of-the-year)
    - [Month](docs/01-get-set.md#month)
    - [Quarter](docs/01-get-set.md#quarter)
    - [Year](docs/01-get-set.md#year)
    - [UTC Offset](docs/01-get-set.md#utc-offset)
    - [Timezone](docs/01-get-set.md#timezone)
    - [Timezone Abbreviation](docs/01-get-set.md#timezone-abbreviation)
    - [Timezone Name](docs/01-get-set.md#timezone-name)
- [Manipulate](docs/02-manipulate.md)
    - [Add Time](docs/02-manipulate.md#add)
    - [Subtract Time](docs/02-manipulate.md#subtract)
    - [Start of Time](docs/02-manipulate.md#start-of-time)
    - [End of Time](docs/02-manipulate.md#end-of-time)
- [Display](docs/03-display.md)
    - [Format](docs/03-display.md#format)
    - [Stringable](docs/03-display.md#string)
    - [Difference](docs/03-display.md#difference)
    - [Timestamp (in seconds)](docs/03-display.md#timestamp-in-seconds)
    - [Timestamp (in milliseconds)](docs/03-display.md#timestamp-in-milliseconds)
    - [Days In Month](docs/03-display.md#days-in-month)
    - [As `DateTime`](docs/03-display.md#as-datetime)
- [Query](docs/04-query.md)
    - [Is Before](docs/04-query.md#is-before)
    - [Is Same](docs/04-query.md#is-same)
    - [Is After](docs/04-query.md#is-after)
    - [Is Same or Before](docs/04-query.md#is-same-or-before)
    - [Is Same or After](docs/04-query.md#is-same-or-after)
    - [Is Between](docs/04-query.md#is-between)
    - [Is Daylight Saving Time](docs/04-query.md#is-daylight-saving-time)
    - [Is Leap Year](docs/04-query.md#is-lear-year)

Requirements
------------

[](#requirements)

- PHP 8+

Resources
---------

[](#resources)

- [Report issues](https://github.com/trickeyone/epoch/issues) and [Send Pull Requests](https://github.com/trickeyone/epoch/pulls)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

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

4

Last Release

937d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

1.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/61d36be58a4cd04cf233882fbeed4d467e564bea9d15b787132b36f9dbb8ce3f?d=identicon)[trickeyone](/maintainers/trickeyone)

---

Top Contributors

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

---

Tags

formattimedatevalidateparseepoch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/trickeyone-epoch/health.svg)

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

###  Alternatives

[moment/moment

Parse, validate, manipulate, and display dates in JavaScript.

48.1k2.1M37](/packages/moment-moment)[timrwood/moment

Parse, validate, manipulate, and display dates in JavaScript.

48.0k17.2k](/packages/timrwood-moment)[fightbulc/moment

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

9693.2M10](/packages/fightbulc-moment)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)

PHPackages © 2026

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