The following snippet makes you format a date field inside a twig file.

{% set date = content.field_job_expiration.value|date('U')|format_date('short') %}
<p>Expiration: {{ date }}</p>

 


Saved you some valuable time?

Donate and get more free time-saving code on this website in the future.