PHPackages                             geniusts/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. geniusts/hijri-dates

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

geniusts/hijri-dates
====================

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

1.2.1(1y ago)104353.2k↓62.3%35[6 issues](https://github.com/GeniusTS/hijri-dates/issues)9MITPHPPHP &gt;=7.1

Since May 5Pushed 1y ago4 watchersCompare

[ Source](https://github.com/GeniusTS/hijri-dates)[ Packagist](https://packagist.org/packages/geniusts/hijri-dates)[ RSS](/packages/geniusts-hijri-dates/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (1)Versions (19)Used By (9)

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

51

—

FairBetter than 95% of packages

Maintenance44

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 86.5% 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 ~171 days

Recently: every ~425 days

Total

18

Last Release

430d ago

PHP version history (2 changes)1.0.0PHP &gt;=7

1.2PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9ec340bd6cc0cbc181d0c41f371d06be7c70742ddee6ad908d9f6f570123406?d=identicon)[aboudeh87](/maintainers/aboudeh87)

---

Top Contributors

[![aboudeh87](https://avatars.githubusercontent.com/u/10183425?v=4)](https://github.com/aboudeh87 "aboudeh87 (45 commits)")[![matriphe](https://avatars.githubusercontent.com/u/277262?v=4)](https://github.com/matriphe "matriphe (2 commits)")[![srjlewis](https://avatars.githubusercontent.com/u/56001?v=4)](https://github.com/srjlewis "srjlewis (2 commits)")[![atmonshi](https://avatars.githubusercontent.com/u/1952412?v=4)](https://github.com/atmonshi "atmonshi (1 commits)")[![hassanhe](https://avatars.githubusercontent.com/u/31159198?v=4)](https://github.com/hassanhe "hassanhe (1 commits)")[![PeterL-INT](https://avatars.githubusercontent.com/u/90758855?v=4)](https://github.com/PeterL-INT "PeterL-INT (1 commits)")

---

Tags

hijrihijri-dateshijri-dates-converter

### Embed Badge

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

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

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402860.1k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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