I want to know why the second line throws an error:
Yii::$app->formatter->dateFormat='yyyy-MM-dd';
echo Yii::$app->formatter->format('14/01/2017','date');
And why is there no error in this case?
Yii::$app->formatter->dateFormat='yyyy-MM-dd';
echo Yii::$app->formatter->format('10/07/2015', 'date');