Date formatting in view

Am trying to format the date from 2015-10-11 to Oct-11-2015

i tried both this

_search.php

1)<?= $form->field($model, Yii::$app->formatter->asDate($this->date_of_birth, ‘long’)) ?>

and

2)<?= $form->field($model, Yii::$app->formatter->asDate($this->date_of_birth, ‘php:MM-dd-yyyy’)) ?>

Whats the problem please

and what is the result you are getting?

for the format you specified php: so you need to use the PHP date format - http://php.net/manual/en/function.date.php#refsect1-function.date-parameters

By that to get the month 3 letter code you need just one M not two as you wrote above

Use yii date format in view

        [


        'attribute'=&gt;'start_date',


        'format'=&gt;['Date','php:d-m-Y']


        ],