📍 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.
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.
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.
jDateTime Requires PHP >= 5.2
You can install this package using composer. 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"
Get a copy of package source code. You can do this in two ways:
- Download ZIP version of the source code and unzip it in desired location
- 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';
Please see examples.php and example-static.php for working examples.