I have problem with using Yii2-formatter. My config is
'formatter' => [
'class' => 'yii\i18n\Formatter',
'defaultTimeZone' => 'Asia/Novosibirsk',
'timeZone' => 'Asia/Novosibirsk',
'currencyCode' => 'RUB',
'locale' => 'ru_RU',
'dateFormat' => 'php:d.m.Y',
'timeFormat' => 'php: H:i:s',
'datetimeFormat' => 'php:d.m.Y H:i',
],
When I try
echo Yii::$app->formatter->asDateTime('15-06-2014 14:10:10');
it work correct - show 15.06.2014 14:10. When I try
echo Yii::$app->formatter->asDateTime('15-06-2015 14:10:10');
it work not correct - show 15.06.2015 15:10. When I set year 2016, it works not corrected too. I try to
echo date('d.m.Y H:i', strtotime('15-06-2015 14:10:10'))
And it works correct for 2015 and 2016 years, PHP-config is right. Could anyone help, what's wrong with my code?