PHP code example of bupy7 / yii2-datetime-converter
1. Go to this page and download the library: Download bupy7/yii2-datetime-converter 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/ */
bupy7 / yii2-datetime-converter example snippets
'dtConverter' => [
'class' => 'bupy7\datetime\converter\Converter',
// 'saveTimeZone' => 'UTC' - by default
// 'saveDate' => 'php:Y-m-d' - by default
// 'saveTime' => 'php:H:i:s' - by default
// 'saveDateTime' => 'php:U' - by default
// add format patterns if need for your locales (by default uses `en`)
'patterns' => [
'ru' => [
'displayTimeZone' => 'Europe/Moscow',
'displayDate' => 'php:d.m.Y',
'displayTime' => 'php:H:i',
'displayDateTime' => 'php:d.m.Y, H:i',
],
],
],