Answers for "use Carbon in twig"

PHP
0

display date time twig

// date
{{ post.published_at|date("m/d/Y") }}

// date time
{{ post.published_at|date('Y-m-d H:i:s') }}
Posted by: Guest on September-18-2020
0

twig date month is not defined

{% set dateTime = date(article.date) %}
<span class="day">{{ dateTime | date('d') }}</span>
<span class="month">{{ dateTime | date('F') }}</span>
<span class="year">{{ dateTime | date('Y') }}</span>
Posted by: Guest on October-30-2020

Browse Popular Code Answers by Language