Download the PHP package eram/daynum without Composer
On this page you can find all versions of the php package eram/daynum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package daynum
Short Description Immutable, zero-runtime-dependency multi-calendar library for PHP 8.1+. Gregorian, Jalali (Shamsi), and Hijri, differentially tested against ICU.
License MIT
Homepage https://github.com/eramhq/daynum
Informations about the package daynum
Daynum
Immutable, zero-runtime-dependency, multi-calendar PHP library.
Daynum is a clean, single-package replacement for the 3–4 libraries PHP developers currently glue together to get Gregorian + Jalali (Shamsi) + Hijri support. It targets PHP 8.1+, requires no ext-intl at runtime, pulls no transitive dependencies, and is differentially tested against ICU on ~220,000 dates per calendar per CI build.
v1 ships Gregorian, Jalali, and Hijri (Saudi Umm al-Qura + tabular civil), with English, Persian, and Arabic locales.
What Daynum is (and isn't)
Daynum IS: multi-calendar date conversion + formatting, immutable arithmetic, locale-aware formatting with PHP date() tokens, a zero-dependency ICU-tested replacement for morilog/jalali.
Daynum is NOT: a timezone library (use toDateTimeImmutable() for DST math), a relative-date parser ("next Monday"), a Carbon replacement (Carbon covers Gregorian + timezones; Daynum covers multi-calendar + correctness), or a framework bridge.
Naming caveat:
Instantis civil, not UTC. Unlikejava.time.Instant, Daynum'sInstantis a calendar-neutral civil datetime:(JDN, time-of-day, timezone label). Two instants with the same JDN and time but different tzLabels represent different physical moments. See docs/en/concepts.md.
| Feature | Daynum | Carbon | morilog/jalali | ext-intl |
|---|---|---|---|---|
| Jalali | Birashk 33-year | No | Birashk (same) | Borkowski |
| Hijri UAQ | Bundled table | No | No | Runtime ICU |
| Hijri Civil | Yes | No | No | Yes |
| Runtime deps | Zero | symfony/* | nesbot/carbon | ext-intl |
| Immutable | Yes | Optional | No | N/A |
| Testing | ICU differential | Unit tests | Unit tests | IS the oracle |
Install
Quick start
Documentation
Learn
- Getting Started — install, first example, 5-minute tour
- Concepts — civil vs. UTC,
Instantvs. view, JDN, immutability - Cookbook — 10+ task-indexed recipes
- FAQ — surprising-but-intentional design decisions
Calendars
- Hijri (civil)
Reference
- API Reference — every type and method
- Arithmetic
- Serialization
Migration & attribution
- Migrating from morilog/jalali
- Algorithms and attribution
Contributing
Bug reports, docs fixes, new locales, and new calendar systems are welcome. See CONTRIBUTING.md for testing, fixture regeneration, and the "how to add a new calendar" checklist.
Links
- CHANGELOG.md — release notes
- LICENSE — MIT
- Issue tracker
License
MIT. See LICENSE.