Yii2 datetime formatter

Dear Yii2ers,

Could you please test this in a simple view?

<?= date(‘Y-m-d H:i:s’) . ’ vs ’ . Yii::$app->formatter->asDateTime(date(‘Y-m-d H:i:s’)) ?>

I have one hour difference between the two.

Yii 2.0.0, French locale, datetime format is to its default value of "medium". French locale is not involved(?) because same issue without it.

If you also have one hour difference, where could it come from?

Thank you

Pierre

There is an open issue:

I found this as a workaround: Yii::$app->formatter->asDateTime(new DateTime(date(‘Y-m-d H:i:s’))).

I.e., going through DateTime object appear to fix the problem.

Thanks.

P.