in my main.php
i have this
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'php:j M Y',
'datetimeFormat' => 'php:d/m/Y h:i a',
'timeFormat' => 'php:H:i A',
'defaultTimeZone' => 'Asia/Singapore',
],
in my view
<?= Yii::$app->formatter->asDateTime('2022-06-14 11:47:08'); ?>
output is 14/06/2022 11:47 am
The time in my database is UTC, and the output doesn’t change to +8GMT. It’s still in UTC. What am i missing here? Thank you.