blob: cc5d6df160d456e165ca1e6e48fa721b2dc8cc9b [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``date_modify``
2===============
3
4The ``date_modify`` filter modifies a date with a given modifier string:
5
6.. code-block:: twig
7
8 {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}
9
10The ``date_modify`` filter accepts strings (it must be in a format supported
11by the `strtotime`_ function) or `DateTime`_ instances. You can combine
12it with the :doc:`date<date>` filter for formatting.
13
14Arguments
15---------
16
17* ``modifier``: The modifier
18
19.. _`strtotime`: https://secure.php.net/strtotime
20.. _`DateTime`: https://secure.php.net/DateTime