alifti/jdf

Persian Jalali date for laravel , This package provide all methods that you need for shamsi/jalali date

dev-main 2021-09-21 05:27 UTC

This package is not auto-updated.

Last update: 2024-04-16 17:32:39 UTC


README

alifattahi/jdf

Laravel 4 Persian jalali date

Installation

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',

    ),

Basic Usage

Examples

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

License

  • 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.