PHPackages                             ahmeraq/hijri-dates - 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. ahmeraq/hijri-dates

ActiveLibrary

ahmeraq/hijri-dates
===================

PHP library to convert Gregorian date to Hijri date and vice versa

02PHP

Since Apr 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ahmeraq/hijri-dates)[ Packagist](https://packagist.org/packages/ahmeraq/hijri-dates)[ RSS](/packages/ahmeraq-hijri-dates/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Hijri date
==========

[](#hijri-date)

a PHP library to convert Gregorian date to Hijri date and vice versa.

It's based on [nesbot/carbon](https://github.com/briannesbitt/Carbon) package.

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

[](#installation)

```
	composer require geniusts/hijri-dates
```

Usage
-----

[](#usage)

- you can immediatly get the hijri date with `Date` class function.

```
	$now = \GeniusTS\HijriDate\Date::now();
	$today = \GeniusTS\HijriDate\Date::today();
	$tomorrow = \GeniusTS\HijriDate\Date::tomorrow();
	$yesterday = \GeniusTS\HijriDate\Date::yesterday();
```

- to convert from Gregorian date to Hijri Date.

```
	$date = \GeniusTS\HijriDate\Hijri::convertToHijri('2017-05-05');
```

- to convert from Hijri date to Gregorian Date.

```
	// This function return a Carbon instance.
	$date = \GeniusTS\HijriDate\Hijri::convertToGregorian(8, 8, 1438);
```

- get date formated string.

```
	use GeniusTS\HijriDate\Date;

	$today = Date::today();

	// use the second parameter to return indian numbers
	echo $today->format('l d F o', Date::INDIAN_NUMBERS);
```

Configurations
--------------

[](#configurations)

- Changing the adjustment days.

```
	\GeniusTS\HijriDate\Hijri::setDefaultAdjustment(1);
```

- Changing the translation language.

```
	use GeniusTS\HijriDate\Translations\Arabic;

	\GeniusTS\HijriDate\Date::setTranslation(new Arabic);
```

- Changing the default toString format language.

```
	\GeniusTS\HijriDate\Date::setToStringFormat('l d F o');
```

- Changing the default numeric system.

```
	use GeniusTS\HijriDate\Date;

	Date::setDefaultNumbers(Date::INDIAN_NUMBERS);
```

---

There is some methods from `Carbon` class you can use it with `Date` class.

---

License
-------

[](#license)

This package is free software distributed under the terms of the MIT license.

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/399092d7eaca5f61b2e3e6954eaf2a54a3daede2eed033a46781cd7ada5d8f54?d=identicon)[ahmeraq](/maintainers/ahmeraq)

---

Top Contributors

[![ahmeraq](https://avatars.githubusercontent.com/u/56633253?v=4)](https://github.com/ahmeraq "ahmeraq (2 commits)")

### Embed Badge

![Health badge](/badges/ahmeraq-hijri-dates/health.svg)

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

PHPackages © 2026

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