Date formatting in view

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

i tried both this


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


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 -

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