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

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

saleh7/hijri-dates
==================

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

1.1.4(7y ago)141MITPHPPHP &gt;=7

Since May 5Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (12)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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 94.9% 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 ~53 days

Recently: every ~127 days

Total

11

Last Release

2809d ago

### Community

Maintainers

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

---

Top Contributors

[![aboudeh87](https://avatars.githubusercontent.com/u/10183425?v=4)](https://github.com/aboudeh87 "aboudeh87 (37 commits)")[![atmonshi](https://avatars.githubusercontent.com/u/1952412?v=4)](https://github.com/atmonshi "atmonshi (1 commits)")[![Saleh7](https://avatars.githubusercontent.com/u/5176469?v=4)](https://github.com/Saleh7 "Saleh7 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M40.2k](/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.6k29](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

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

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k4](/packages/pimcore-data-importer)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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