How to display DATE(yy-mm-dd) from mysql to 'dd-mm-yy'?


I have DATE field in my tables.

I need to display ‘dd-mm-yy’.

How can I do this with Yii?

This should be do in model or view and HOW?

In the view, because it belongs to presentation.

  1. (preferably) with CDateFormatter (guide)

  2. with plain php:

<?php echo date('d-m-y', strtotime($model->date)); ?>