Skip to content
Advertisement

How to change dateformat on Yii platform?

I am new to the Yii platform, and I am wondering how to change the dateformat. It’s currently in the American date format that is YYYY-MM-DD. I want it to be DD-MM-YYYY. Is there any way to this?

Advertisement

Answer

config file add in ‘components’ => [] You can add it and edit it to your style.

'formatter' => [
    'dateFormat' => 'yyyy-MM-dd',
    'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
    'decimalSeparator' => ',',
    'thousandSeparator' => ' ',
],
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement