PHPackages                             elephantsgroup/eg-jdate - 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. elephantsgroup/eg-jdate

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

elephantsgroup/eg-jdate
=======================

Yii2 Jalali date &amp; time

1.0.0(8y ago)0537MITJavaScriptPHP &gt;=7.0.0

Since Apr 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ElephantsGroup/eg-jdate)[ Packagist](https://packagist.org/packages/elephantsgroup/eg-jdate)[ Docs](http://elephantsgroup.com)[ RSS](/packages/elephantsgroup-eg-jdate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (7)

Jalali Date
===========

[](#jalali-date)

Yii2 Jalali date &amp; time library based on mohammad-mahdy/yii2-jdate.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist elephantsgroup/eg-jdate "*"

```

or add

```
"elephantsgroup/eg-jdate": "*"

```

to the require section of your `composer.json` file.

Usage of `DateTime`
===================

[](#usage-of-datetime)

Once the extension is installed, add it as a component :

```
'jdate' => [
	'class' => 'elephantsGroup\jDate\DateTime'
]
```

Now you can use in your project:

```
Yii::$app->jdate->date('Y-m-d');
```

You can access dates and times as variable :

```
Yii::$app->jdate->Y;
```

Usage of `DatePicker`
=====================

[](#usage-of-datepicker)

It is a widget to make a input, box to giver jalali date from user.

A basic usage:

```
