blob: 417b8a9c62b9799cad383346ec48c3671a29c02d [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``format_time``
2===============
3
4The ``format_time`` filter formats a time. It behaves in the exact same way as
5the :doc:`format_datetime<format_datetime>` filter, but without the date.
6
7.. note::
8
9 The ``format_time`` filter is part of the ``IntlExtension`` which is not
10 installed by default. Install it first:
11
12 .. code-block:: bash
13
14 $ composer require twig/intl-extra
15
16 Then, on Symfony projects, install the ``twig/extra-bundle``:
17
18 .. code-block:: bash
19
20 $ composer require twig/extra-bundle
21
22 Otherwise, add the extension explicitly on the Twig environment::
23
24 use Twig\Extra\Intl\IntlExtension;
25
26 $twig = new \Twig\Environment(...);
27 $twig->addExtension(new IntlExtension());
28
29Arguments
30---------
31
32* ``locale``: The locale
33* ``timeFormat``: The time format
34* ``pattern``: A date time pattern
35* ``timezone``: The date timezone
36* ``calendar``: The calendar (Gregorian by default)