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

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

hmdshariati/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.

00PHPCI failing

Since Jun 7Pushed 3y agoCompare

[ Source](https://github.com/hmdshariati/my-jalali)[ Packagist](https://packagist.org/packages/hmdshariati/jalali)[ RSS](/packages/hmdshariati-jalali/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (0)

morilog/jalali
==============

[](#morilogjalali)

- This package compatible with Laravel 5
- This package was forked from [Miladr/Jalali](http://github.com/miladr/jalai) in previous version and fixed bugs and customized by [Morilog](http://morilog.ir)

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

[](#installation)

Run the Composer update comand

```
$ composer require morilog/jalali

```

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

```
    'providers' => [

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

    ],
    .
    .
    .
    .
    .
    'alias' => [
        ...
        'jDate' => 'Morilog\Jalali\Facades\jDate',
        'jDateTime' => 'Morilog\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

// 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

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

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/84eb62a2993e5694109cae157e9212915fb429c5f328fe6ce795a0a074e1a3f7?d=identicon)[hmdshariati](/maintainers/hmdshariati)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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