PHPackages                             majidcode/easy-jalali - 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. majidcode/easy-jalali

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

majidcode/easy-jalali
=====================

Convert and format Jalali date type in PHP.

1.0.0(4y ago)581GPL-3.0-onlyPHPPHP &gt;=7.2

Since Mar 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MajideND/Easy-Jalali)[ Packagist](https://packagist.org/packages/majidcode/easy-jalali)[ Docs](https://majid.codes)[ RSS](/packages/majidcode-easy-jalali/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Easy Jalali for PHP V1.0.0
==========================

[](#easy-jalali-for-php-v100)

- Jalali calendar converter for Persian users in Iran, Afghanistan and other countries that use Jalali calendar.
- Very thanks of other open-source Jalali libraries: [morilog/jalali](https://github.com/morilog/jalali), [jalaali/jalaali-js](https://github.com/jalaali/jalaali-js) and [jdf](https://jdf.scr.ir/jdf)
- In some cases, we may have used some codes or ideas on some of the named libraries.
- Persian (پارسی) Docs: [majid.codes/easy-jalali](https://majid.codes/easy-jalali?lang=fa)

How to install:
---------------

[](#how-to-install)

- Using Composer

    ```
    composer require majidcode/easy-jalali

    ```

Note: this library has been tested in Laravel 8.x and Laravel 9.x.

How to use:
-----------

[](#how-to-use)

### 1. Create your date from original format:

[](#1-create-your-date-from-original-format)

Create a date with one of the `fromJalali()`, `fromGeorgian()` or `fromCarbon()` methods.

Example:

```
//From Georgian:
$georgianDate = JalaliDate::fromGeorgian('2022-01-12 10:59:59', 'Y-d-m H:i:s');
echo $georgianDate->month();

//From Jalali:
$JalaliDate = JalaliDate::fromJalali('1399-12-12 08:29:59', 'Y-m-d H:i:s');
echo $JalaliDate->month();

//From Carbon:
$carbonDate = JalaliDate::fromCarbon(Carbon::now());
echo $carbonDate->month();
```

### 2. Convert to your format:

[](#2-convert-to-your-format)

You can use `toGeorgian()` or `toJalali()` functions to convert your date.

Example:

```
//From Georgian to Jalali:
$georgianDate = JalaliDate::fromGeorgian('2022-01-12 10:59:59', 'Y-d-m H:i:s');
$JalaliDate = $georgianDate->toJalali();

//From Jalali to Georgian:
$JalaliDate = JalaliDate::fromJalali('1399-12-12 08:29:59', 'Y-m-d H:i:s');
$georgianDate = $JalaliDate->toGeorgian();

//From Carbon to Jalali:
$carbonDate = JalaliDate::fromCarbon(Carbon::now());
$JalaliDate = $carbonDate->toJalali();
```

### 3. Get your result or format:

[](#3-get-your-result-or-format)

You can use [document](#documention) to get different parameters. Format for Georgian date is [PHP date formats](https://www.php.net/manual/en/datetime.format.php) and Jalali dates is like PHP but has been changed or not supported in some cases.

Example:

```
//From Georgian to Jalali:
$georgianDate = JalaliDate::fromGeorgian('2022-01-12 10:59:59', 'Y-d-m H:i:s');
$JalaliDate = $georgianDate->toJalali();
echo $JalaliDate->toFormat('ماه F از Y-m-d و h:i:s A');
```

Example codes:
--------------

[](#example-codes)

I have provided some examples in `./example` folder that you are easy to use!

Documention:
------------

[](#documention)

### Supported format characters:

[](#supported-format-characters)

KeyFor What?Supported in GeorgianSupported in JalaliExample returned valuesYA full numeric representation of a year, 4 digits+ Yes+ YesExamples: 2021, 1401yA two digit representation of a year+ Yes+ YesExamples: 21 or 01mNumeric representation of a month, with leading zeros+ Yes+ Yes01 through 12nNumeric representation of a month, without leading zeros+ Yes+ Yes1 through 12FA full textual representation of a month, such as January or March+ Yes+ YesJanuary through December - فروردین through اسفندdDay of the month, 2 digits with leading zeros+ Yes+ Yes01 to 31jDay of the month without leading zeros+ Yes+ Yes1 to 31aLowercase Ante meridiem and Post meridiem+ Yes+ Yesam or pm - ق.ظ or ب.ظAUppercase Ante meridiem and Post meridiem+ Yes+ YesAM or PM - قبل از ظهر or بعد از ظهرH24-hour format of an hour with leading zeros+ Yes+ Yes00 through 23h12-hour format of an hour with leading zeros+ Yes+ Yes01 through 12G24-hour format of an hour without leading zeros+ Yes+ Yes0 through 23g12-hour format of an hour without leading zeros+ Yes+ Yes1 through 12iMinutes with leading zeros+ Yes+ Yes00 to 59sSeconds with leading zeros+ Yes+ Yes00 through 59MA short textual representation of a month, three letters+ Yes- NoJan through DecDA textual representation of a day, three letters+ Yes- NoMon through SunlA full textual representation of the day of the week+ Yes- NoSunday through SaturdayNISO 8601 numeric representation of the day of the week+ Yes- No1 (for Monday) through 7 (for Sunday)SEnglish ordinal suffix for the day of the month, 2 characters+ Yes- Nost, nd, rd or th. Works well with jwNumeric representation of the day of the week+ Yes- No0 (for Sunday) through 6 (for Saturday)zThe day of the year (starting from 0)+ Yes- No0 through 365WISO 8601 week number of year, weeks starting on Monday+ Yes- NoExample: 42 (the 42nd week in the year)tNumber of days in the given month+ Yes- No28 through 31LWhether it's a leap year+ Yes- No1 if it is a leap year, 0 otherwise.---Other Official PHP date formats+ Yes- NoCheck [PHP Document](https://www.php.net/manual/en/datetime.format.php)### Input Functions:

[](#input-functions)

Function NameInputs`fromJalali()`String $JalaliDate: Jalali datetime string, String $format (default: 'Y-m-d H:i:s'): Jalali datetime format`fromGeorgian()`String $georgianDate: Georgian datetime string, String $format (default: 'Y-m-d H:i:s'): Georgian datetime format`fromCarbon()`Carbon $carbon: Carbon DateTime### Convert Functions:

[](#convert-functions)

Function NameFor what?Requirement`toJalali()`To convert your date to Jalali calenderUsing after `fromGeorgian()` or `fromCarbon()``toGeorgian()`To convert your date to Georgian calenderUsing after `fromJalali()`### Output Functions:

[](#output-functions)

Function NameInputReturn`toFormat()`String $format (default: 'Y-m-d H:i:s'): Datetime format based on your date typeString $resultDateByFormat: DateTime based on your $format from input`year()`---$year`month()`---$month`day()`---$day`hour()`---$hour`minute()`---$minute`second()`---$second

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

1577d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104029?v=4)[Majid Jamaleldine](/maintainers/majidj)[@MajidJ](https://github.com/MajidJ)

---

Top Contributors

[![MajideND](https://avatars.githubusercontent.com/u/47532531?v=4)](https://github.com/MajideND "MajideND (1 commits)")

---

Tags

datetimejalalijalali-calendarlaravelphpshamsishamsi-calendarphplaraveldatetimetimedate

### Embed Badge

![Health badge](/badges/majidcode-easy-jalali/health.svg)

```
[![Health](https://phpackages.com/badges/majidcode-easy-jalali/health.svg)](https://phpackages.com/packages/majidcode-easy-jalali)
```

###  Alternatives

[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.6M3](/packages/kartik-v-php-date-formatter)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14484.2k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21031.3k2](/packages/zjkal-time-helper)[maherelgamil/arabicdatetime

Easy and useful tool to generate arabic or hijri date with multi-language support for laravel

414.6k](/packages/maherelgamil-arabicdatetime)[p3ym4n/jdate

Date converter from Jalali to Georgian and vice versa. It has Carbon instance inside and it's Laravel friendly.

101.8k2](/packages/p3ym4n-jdate)

PHPackages © 2026

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