Yii2 date format slash probelm

Yii::$app->formatter->asDatetime($model->date_in, "short");

when I use the formatter I get the date as ‘04/10/19 12:12’ but I want it to be like ‘04-10-19 12:12’ ?

can it be done by a standart way like configuring the formatter compnent in web.php ?

this is what I got in web.php
'formatter' => [ 'class' => 'yii\i18n\Formatter', 'dateFormat' => 'php:d-M-Y', 'datetimeFormat' => 'php:d-M-Y H:i:s', 'timeFormat' => 'php:H:i:s', 'decimalSeparator' => ',', 'thousandSeparator' => ' ', 'currencyCode' => 'XAF', ],

Yes and then the defaults are used when you don’t pass the format argument (like "short" in your case).

so normaly it’s supposed to format the give date according to the format in web.php
which is ‘date_format’ => ‘php:d-M-Y’ right ?
if it is right why I get the date as ‘04/10/19’ ?
I want it to be ‘04-10-19’ ?

php:d-M-Y gives you 04-Oct-2019.

To get 04-10-19 use php:d-m-Y or dd-MM-y (second one is ICU format).

thank you so much for your time and answer @Bizley ,

changing the format to ‘php:d-m-Y’ resolved my problem.