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

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

mjm/jdate
=========

Jalali date &amp; time.

1.1(9y ago)32161BSD-3-ClauseJavaScript

Since May 24Pushed 9y ago2 watchersCompare

[ Source](https://github.com/2012mjm/yii2-jdate)[ Packagist](https://packagist.org/packages/mjm/jdate)[ RSS](/packages/mjm-jdate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

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

[](#jalali-date)

Jalali date &amp; time is an extension for yii2.

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

[](#installation)

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

Either run

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

```

or add

```
"mjm/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' => 'mjm\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:

```
