Date conversions

Hi everyone,

I save my dates in the format datetime in mysql.
I just want to format them for display resons.

I found 2 ways. Both work. Is there a difference or a preferred one?

<td><?= h($ticket->created->i18nFormat('dd.MM.yyyy')) ?></td>
<td><?= h($ticket->created->format('d.m.Y')) ?></td>

Thank you!

:pray:

both are fine, just one uses PHP’s default date format strings and the other uses the ICN format strings.

1 Like

Perfect, and thank you for the quick reply. :+1: