PHPackages                             alirezab/jdatetime - 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. alirezab/jdatetime

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

alirezab/jdatetime
==================

Jalali (Shamsi) DateTime class written in PHP, Supports year higher than 2038

08PHP

Since May 2Pushed 6y agoCompare

[ Source](https://github.com/Besharatnia/jDateTime)[ Packagist](https://packagist.org/packages/alirezab/jdatetime)[ RSS](/packages/alirezab-jdatetime/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

UNMAINTAINED
============

[](#unmaintained)

⚠️ This package is deprecated and unmaintained. Please **DO NOT** use it in production unless it’s absolutely necessary and at your own risk. There are several other modern Shamsi/Jalali date packages out there like [this one](http://farhadi.ir/blog/1389/02/10/persian-calendar-for-php-53/) which you can use.

📍 If you happen to be a php developer and want to maintain this project, please give me a shout so I can give you write access to this project.

jDateTime
=========

[](#jdatetime)

PHP class to convert dates from Gregorian calendar system to Jalali calendar system and vice versa. Supports dates beyond 2038.
Jalali, also known as Shamsi or Hijri Shamsi is the Iranian calendar system.
[![Build Status](https://camo.githubusercontent.com/345f5f6a14a59f32e721550f802ebad672b8df0d8c4a115df77672866b068e2f/68747470733a2f2f7472617669732d63692e6f72672f73616c6c61722f6a4461746554696d652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/sallar/jDateTime)

About v2.2.0
============

[](#about-v220)

PHP's default `date` function does not support years higher than 2038, so the `DateTime` class was introduced in PHP5 to solve this problem and provide more sophisticated date methods. Iranian users have been using an old `jdate` function to convert Gregorian date to the Jalali equivalent, which is completely based on the old php `date` function so its pretty much out-dated.

Requirements
============

[](#requirements)

jDateTime Requires **PHP &gt;= 5.2**

Installation
============

[](#installation)

Using Composer
--------------

[](#using-composer)

You can install this package using [composer](https://getcomposer.org). Add this package to your `composer.json`:

```
"require": {
	"sallar/jdatetime": "dev-master"
}

```

or if you prefer command line, change directory to project root and:

```
php composer.phar require "sallar/jdatetime":"dev-master"

```

Manual Installation
-------------------

[](#manual-installation)

Get a copy of package source code. You can do this in two ways:

1. Download ZIP version of the source code and unzip it in desired location
2. Run `git clone https://github.com/sallar/jDateTime.git` to clone this repository

After getting a copy of source code, it is enough to include `jdatetime.class.php` where you need to use it.

```
require_once 'path/to/source/jdatetime.class.php';
```

Examples
========

[](#examples)

Please see [examples.php](examples.php) and [example-static.php](examples-static.php) for working examples.

Contributors:
=============

[](#contributors)

- [Sallar Kaboli](http://sallar.me)
- [Omid Pilevar](http://pilevar.ir)
- [Afshin Mehrabani](http://afshinm.name)
- [Amir Latifi](http://amiir.me)
- [Ruhollah Namjoo](https://github.com/namjoo)

License
-------

[](#license)

jDateTime was created by [Sallar Kaboli](http://sallar.me) and released under the [MIT License](http://opensource.org/licenses/mit-license.php).

Copyright (C) 2016 [Sallar Kaboli](http://sallar.me)

Original Jalali to Gregorian (and vice versa) convertor:
Copyright (C) 2000 Roozbeh Pournader and Mohammad Toossi

```
The MIT License (MIT)

Copyright (C) 2003-2016 Sallar Kaboli

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

1- The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

2- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

```

Resources
=========

[](#resources)

- [List of supported timezones](http://www.php.net/manual/en/timezones.php)
- [Documentation and Instructions in Persian](http://sallar.me/farsi/projects/jdatetime/)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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/b3ad2fd47cb9955f39a2919346cdad306a8500fe457177dd6e8d042609c0d576?d=identicon)[Alirezab](/maintainers/Alirezab)

### Embed Badge

![Health badge](/badges/alirezab-jdatetime/health.svg)

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

PHPackages © 2026

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