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

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

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.

0.0.7(11y ago)479.6k135[9 issues](https://github.com/miladr/jalali/issues)2MITPHPPHP &gt;=5.3.0

Since Oct 26Pushed 1y ago5 watchersCompare

[ Source](https://github.com/miladr/jalali)[ Packagist](https://packagist.org/packages/miladr/jalali)[ RSS](/packages/miladr-jalali/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (2)

miladr/jalali
=============

[](#miladrjalali)

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](https://github.com/sallar/laravel-jdate) by [Sallar Kaboli](http://sallar.me).

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

[](#installation)

In the `require` key of `composer.json` file add the following

```
    "miladr/jalali": "dev-master"
```

Run the Composer update comand

```
$ composer update

```

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

```
    'providers' => array(

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

    ),
```

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() // ۱۰ دقیقه پیش
```

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

36

—

LowBetter than 82% of packages

Maintenance24

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.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

Unknown

Total

1

Last Release

4215d ago

### Community

Maintainers

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

---

Top Contributors

[![miladr](https://avatars.githubusercontent.com/u/1630638?v=4)](https://github.com/miladr "miladr (24 commits)")[![ocalypto](https://avatars.githubusercontent.com/u/829777?v=4)](https://github.com/ocalypto "ocalypto (1 commits)")[![puraminy](https://avatars.githubusercontent.com/u/5293185?v=4)](https://github.com/puraminy "puraminy (1 commits)")[![SCR-IR](https://avatars.githubusercontent.com/u/43960795?v=4)](https://github.com/SCR-IR "SCR-IR (1 commits)")

---

Tags

laraveldatetimedateJalali

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/miladr-jalali/health.svg)](https://phpackages.com/packages/miladr-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)[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)
