Laravel 4 Persian jalali date
In the require
key of composer.json
file add the following
"alifti/jdf": "dev-master"
Run the Composer update comand
$ composer update
In your config/app.php
add 'Alifti\jdf\jdfServiceProvider'
to the end of the $providers
array
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Alifti\Jdf\JdfServiceProvider',
),
Some Examples (based on examples provided by Sallar)
// Current date time
$date = jdf::jdate('H:i:s Y/m/d');
// current date time in unix time format
$date = jdf::jmktime();
// or create your jalali unix tiem format
$date = jdf::jmktime($h,$m,$s,$jm,$jd,$jy);
Persian guide for all methods in this package : Persian guide
- This package is created based on jdf
- Jalali (Shamsi) DateTime class included in the package is created by [Ali Fattahi] and is released under the MIT License.
- This package was created by [Ali Fattahi] and is released under the MIT License.