PHP code example of maddoger / yii2-datetimepicker

1. Go to this page and download the library: Download maddoger/yii2-datetimepicker 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/ */

    

maddoger / yii2-datetimepicker example snippets


use maddoger\widgets\DateTimePicker;

echo $form->field($model, 'field')->widget(DateTimePicker::className());

[
    'class' => DateTimeBehavior::className(),
    'attributes' => ['published_at'],
    'originalFormat' => 'U', //original format
    'originalTimeZone' => 'UTC', //original timezone
    
    'timeZone' => 'Europe/London', //local timezone
    'format' => 'datetime', //local format, Formatter format
]

[
    'class' => DateTimeBehavior::className(),
    'attributes' => ['birth_date'],
    'originalFormat' => 'Y-m-d',
    'format' => 'date',
    'timeZone' => 'UTC',
]

php composer.phar