PHP code example of meysampg / yii2-intldatebehavior

1. Go to this page and download the library: Download meysampg/yii2-intldatebehavior library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

meysampg / yii2-intldatebehavior example snippets


public function behaviors()
{
    return [
        IntlDateBehavior::className(),
    ];
}

public function behaviors()
{
    return [
        [
            'class' => IntlDateBehavior::className(),
            'timestampAttributes' => ['create_time', 'update_time', 'another_time'],
            'calendar' => 'persian',
            'format' => 'php:d F Y، H:i:s',
            'locale' => 'fa',
            'tz' => 'Asia/Tehran'
        ],
    ];
}

public function behaviors()
{
    return [
        IntlDateBehavior::className(),
    ];
}



return [
    // some params are here
    'dateTimeFormat' => 'yyyy/MM/dd, HH:mm:ss',
    'dateTimeCalendar' => 'persian',
    'dateTimeLocale' => 'fa',
    'dateTimeZone' => 'Asia/Tehran',
];