Skip to content
eramhqPublic

About

Immutable, zero-runtime-dependency multi-calendar library for PHP 8.1+. Gregorian, Jalali (Shamsi), and Hijri, differentially tested against ICU.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Daynum

Immutable multi-calendar dates for PHP 8.1+: Gregorian, Jalali, Hijri Umm al-Qura and civil Hijri. No Composer runtime dependencies or runtime ext-intl requirement.

Install

composer require eram/daynum:1.0.0-beta.4

These guides accompany v1.0.0-beta.4, a prerelease dated October 8, 2026. See release status and the changelog.

Quick start

<?php
require 'vendor/autoload.php';

use Eram\Daynum\CivilDateTime;

$d = CivilDateTime::fromGregorian(2026, 4, 8, 14, 30, 0, 'Asia/Tehran');
echo $d->gregorian()->format('Y-m-d H:i'), "\n";
echo $d->jalali()->withLocale('fa')->withDigits('persian')->format('l j F Y'), "\n";
echo $d->hijri()->format('Y/m/d'), "\n";
echo $d->hijriCivil()->format('Y/m/d'), "\n";
2026-04-08 14:30
چهارشنبه ۱۹ فروردین ۱۴۰۵
1447/10/20
1447/10/20

Calendar conversion preserves wall-clock time and the optional timezone label. Arithmetic returns CivilDateTime; select a view again to format. Use timestamps or native PHP for elapsed time and timezone conversion.

Documentation

License

MIT. See algorithm attribution for upstream sources.

About

Immutable, zero-runtime-dependency multi-calendar library for PHP 8.1+. Gregorian, Jalali (Shamsi), and Hijri, differentially tested against ICU.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages