Browse project documentation
Daynum overview
Choose a calendar and find the guide for your task.
Daynum is an immutable PHP library for converting, displaying and calculating civil dates in Gregorian, Jalali and two Hijri calendars. It requires PHP 8.1+ and has no Composer runtime dependencies; ext-intl is not needed at runtime.
Release status
These guides accompany v1.0.0-beta.4, dated October 8, 2026. It is a prerelease, not a stable 1.0 release. This version includes the bilingual guides, stricter repeated AM/PM and offset parsing, and improved name normalization. The parsing guide identifies behavior added in beta.4; beta.3 does not include those changes. See the release changelog.
Choose a task
- Install and run your first example.
- Understand values, views and conversion.
- Display localized dates or read user input.
- Add months, compare dates and find boundaries.
- Convert timezones and calculate elapsed time.
- Save dates, handle errors, or follow a recipe.
- Migrate from morilog/jalali, consult the API reference, or review algorithms and limitations.
Choose a calendar
| Calendar | Entry points | Supported construction years |
|---|---|---|
| Gregorian | fromGregorian() / gregorian() | -9999–9999, including year 0 |
| Jalali | fromJalali() / jalali() | 1–3177 |
| Hijri Umm al-Qura | fromHijri() / hijri() | AH 1300–1600 |
| Civil Hijri | fromHijriCivil() / hijriCivil() | AH 1–9666 |
A CivilDateTime stores a day, wall-clock time and optional timezone label. Calendar conversion keeps the time and label. It does not convert an instant between timezones. Use PHP’s DateTimeImmutable or timestamps for that work; see timezones.