PHPackages                             mmkargar/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. [Localization &amp; i18n](/categories/localization)
4. /
5. mmkargar/jalali

ActiveLibrary[Localization &amp; i18n](/categories/localization)

mmkargar/jalali
===============

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in Laravel 4 applications, based on Jalali (Shamsi) DateTime class. This Package is based on a Laravel 3 bundle sallar/laravel-jdate by Sallar Kaboli.

v1.0.1(5y ago)015MITPHPPHP &gt;=5.4

Since Dec 5Pushed 5y ago1 watchersCompare

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

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

mmkargar/jalali
===============

[](#mmkargarjalali)

- This package compatible with Laravel 5

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

[](#installation)

Run the Composer update comand

```
$ composer require mmkargar/jalali

```

In your `config/app.php` add `'MmKargar\Jalali\JalaliServiceProvider'` to the end of the `$providers` array

```
    'providers' => [

        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',
        ...
        'MmKargar\Jalali\JalaliServiceProvider',

    ],
    .
    .
    .
    .
    .
    'alias' => [
        ...
        'jDate' => 'MmKargar\Jalali\Facades\jDate',
        'jDateTime' => 'MmKargar\Jalali\Facades\jDateTime',
    ]
```

Basic Usage
-----------

[](#basic-usage)

Examples
--------

[](#examples)

Some Examples (based on examples provided by Sallar)

```
// default timestamp is now
$date = jDate::forge();

// pass timestamps
$date = jDate::forge(1333857600);

// pass strings to make timestamps
$date = jDate::forge('last sunday');

// get the timestamp
$date = jDate::forge('last sunday')->time(); // 1333857600

// format the timestamp
$date = jDate::forge('last sunday')->format('%B %d، %Y'); // دی 02، 1391

// get a predefined format
$date = jDate::forge('last sunday')->format('datetime'); // 1391-10-02 00:00:00
$date = jDate::forge('last sunday')->format('date'); // 1391-10-02
$date = jDate::forge('last sunday')->format('time'); // 00:00:00

// amend the timestamp value, relative to existing value
$date = jDate::forge('2012-10-12')->reforge('+ 3 days')->format('date'); // 1391-07-24

//convert jalali to gregorian
$date = JDate::jalaliToGregorian("1399/09/15"); // output : 2020-12-05

// get relative 'ago' format
$date = jDate::forge('now - 10 minutes')->ago() // ۱۰ دقیقه پیش

//date_parse_from_format for jalali date
$date = jDate::parseFromFormat('Y/m/d', '1393/01/18');
echo $date['year']; //1393
echo $date['month']; //01
echo $date['day']; //18
```

Formatting
----------

[](#formatting)

For help in building your formats, checkout the [PHP strftime() docs](http://php.net/manual/en/function.strftime.php).

Notes
-----

[](#notes)

The class relies on `strtotime()` to make sense of your strings, and `strftime()` to make the format changes. Just always check the `time()` output to see if you get false timestamps... which means the class couldn't understand what you were telling it.

License
-------

[](#license)

- This bundle is created based on [Laravel-Date](https://github.com/swt83/laravel-date) by [Scott Travis](https://github.com/swt83) (MIT Licensed).
- [Jalali (Shamsi) DateTime](https://github.com/sallar/jDateTime) class included in the package is created by [Sallar Kaboli](http://sallar.me) and is released under the MIT License.
- This package was created by [Milad Rey](http://milad.io) and is released under the MIT License.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~0 days

Total

2

Last Release

1984d ago

### Community

Maintainers

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

---

Top Contributors

[![miladr](https://avatars.githubusercontent.com/u/1630638?v=4)](https://github.com/miladr "miladr (21 commits)")[![morilog](https://avatars.githubusercontent.com/u/4139179?v=4)](https://github.com/morilog "morilog (15 commits)")[![mahdiraad](https://avatars.githubusercontent.com/u/5654587?v=4)](https://github.com/mahdiraad "mahdiraad (3 commits)")[![MmKargar](https://avatars.githubusercontent.com/u/11253027?v=4)](https://github.com/MmKargar "MmKargar (3 commits)")[![ocalypto](https://avatars.githubusercontent.com/u/829777?v=4)](https://github.com/ocalypto "ocalypto (1 commits)")

---

Tags

laraveldatetimedateJalalimorilogMmKargar

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jenssegers/date

A date library to help you work with dates in different languages

1.8k11.2M80](/packages/jenssegers-date)[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[hekmatinasser/verta

This Package helps developers to work with Jalali Datetime class for Laravel Framework PHP

657530.5k27](/packages/hekmatinasser-verta)[miladr/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in Laravel 4 applications, based on Jalali (Shamsi) DateTime class. This Package is based on a Laravel 3 bundle sallar/laravel-jdate by Sallar Kaboli.

479.6k2](/packages/miladr-jalali)[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)
