PHPackages                             celest/celest - 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. celest/celest

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

celest/celest
=============

A port of JSR310 to PHP

2.0.x-dev(5y ago)92.1k1[1 issues](https://github.com/celest-time/celest/issues)[1 PRs](https://github.com/celest-time/celest/pulls)GPL-2.0PHPPHP &gt;=5.6

Since Oct 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/celest-time/celest)[ Packagist](https://packagist.org/packages/celest/celest)[ RSS](/packages/celest-celest/feed)WikiDiscussions master Synced yesterday

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

Celest
======

[](#celest)

[![Build Status](https://camo.githubusercontent.com/0bacf276c06a5182d28c1c41aaf66c8671d8e21a6f8e5a93ffa44856ecd100d8/68747470733a2f2f7472617669732d63692e6f72672f63656c6573742d74696d652f63656c6573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/celest-time/celest) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/1e2e59b94a3d78d63f4076167af60634da195c795d566ee73e57c0d886bba1e0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63656c6573742d74696d652f63656c6573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/celest-time/celest/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/12aec4465a0d62e9d22a706f9dbc1c44a2a6c97ab68b5ae5a2ab2507f23931a6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63656c6573742d74696d652f63656c6573742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/celest-time/celest/?branch=master)

Celest provides a alternative date and time API for PHP. It allows you to correctly manage date and time and to do operations on them. It is based on the [JSR-310](http://www.threeten.org/) project for Java 8.

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

[](#installation)

The recommended way to install Celest is through [Composer](https://getcomposer.org/):

```
composer require celest/celest

```

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

[](#requirements)

PHP &gt;= 5.6 with GMP and intl extension or a current release of HHVM

Timezone Data
-------------

[](#timezone-data)

Celest uses IANA's [time zone database](https://www.iana.org/time-zones). Changes are distributed via the [Celest tzdata](https://github.com/celest-time/tzdata) repo.

Localization
------------

[](#localization)

Besides the ISO 8061 calendar, the Minguo and Thai Buddhist calendars are supported. Localization of Month, weekday etc., localized parsing/formatting patterns and names of time zones are supported and provided via the intl extension.

Testing
-------

[](#testing)

You need to install phpunit manually and a version of doctrine/instantiator that's compatible with php5:

```
composer require --dev phpunit/phpunit:^5.7 rianium/paratest:~0.15.0 doctrine/instantiator:~1.0.5

```

Then run `make test` for the full testsuite or `make test-short` for a testsuite that runs in under a minute. Warning: Paratest currently doesn't display skipped or incomplete tests in all cases.

Interoperability with native \\DateTime
---------------------------------------

[](#interoperability-with-native-datetime)

As PHP's native `\DateTime` mixes Instants with local Date/Time there's two different conversions:

- Instant.fromDateTime creates an Instant from a `\DateTime` object
- Instant.toDateTime converts an Instant to a `\DateTime` object in the UTC timezone
- ZonedDateTime.fromDateTime creates a ZonedDateTime object from a `\DateTime` object
- ZonedDateTime.toDateTime converts ZonedDateTime object to a `\DateTime` object
- TODO TimeZones

Known limitations
-----------------

[](#known-limitations)

- No builtin ranges
- Multibyte string parsing is not fully tested
- Parsing of timezone names is broken on HHVM. See [\#6852](https://github.com/facebook/hhvm/issues/6852)
- Offset based timezones can't be converted to native `\DatetimeZones` on HVVM. See [\#6783](https://github.com/facebook/hhvm/issues/6783)
- Celest is not suited if you care about correct historical dates before ~1970 or subsecond synchronization with external timesystems like TAI, UT or scientific uses of UTC

Roadmap
-------

[](#roadmap)

- Performance optimizations
- Optimized serialization
- Doctrine mappings
- Check passed types to behave like php 7 with type annotations
- Documentation cleanup
- Support for the Japanese and Hijrah calendars
- 2.0 with full use of PHP 7 type annotations for primitive types and return values.

Similar projects:
-----------------

[](#similar-projects)

-
-
-

### In other languages:

[](#in-other-languages)

-
-
-

Acknowledgements
----------------

[](#acknowledgements)

Thanks to Stephen Colebourne and Michael Nascimento Santos the original authors of [JSR-310](http://www.threeten.org/). Also to [Flixbus](https://www.flixbus.de/) who partially sponsored the work on Celest.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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 ~738 days

Total

3

Last Release

2073d ago

Major Versions

0.1.x-dev → 2.0.x-dev2020-10-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/630711?v=4)[Steffen Hanikel](/maintainers/hanikesn)[@hanikesn](https://github.com/hanikesn)

---

Top Contributors

[![hanikesn](https://avatars.githubusercontent.com/u/630711?v=4)](https://github.com/hanikesn "hanikesn (367 commits)")

### Embed Badge

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

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

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k77.4k89](/packages/pocketmine-pocketmine-mp)[godruoyi/php-snowflake

An ID Generator for PHP based on Snowflake Algorithm (Twitter announced).

8652.6M65](/packages/godruoyi-php-snowflake)[bitwasp/bitcoin

PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings

1.1k537.0k43](/packages/bitwasp-bitcoin)[pocketmine/raklib

A RakNet server implementation written in PHP

101584.9k13](/packages/pocketmine-raklib)[bitwasp/buffertools

Toolbox for working with binary and hex data. Similar to NodeJS Buffer.

65779.0k42](/packages/bitwasp-buffertools)[pocketmine/math

PHP library containing math related code used in PocketMine-MP

43591.6k19](/packages/pocketmine-math)

PHPackages © 2026

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