How can I display a formatted date from a Unix timestamp in twig?

filter, php, symfony, twig, unix-timestamp

Solution

There is a filter called `date`.

In the following example `mydate` equals `1286199900`:

{{ mydate|date }}           <!-- October 4, 2010 13:45 -->
{{ mydate|date('d/m/Y') }}  <!-- 04/10/2010 -->

Problem

I would like to display a formatted date in twig by applying a filter to a Unix timestamp. Is such a feature available in twig?

Original source