HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: /virtual/nagasaki/public_html/ec/vendor/twig/twig/doc/filters/date_modify.rst
``date_modify``
===============

.. versionadded:: 1.9.0
    The date_modify filter has been added in Twig 1.9.0.

The ``date_modify`` filter modifies a date with a given modifier string:

.. code-block:: jinja

    {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}

The ``date_modify`` filter accepts strings (it must be in a format supported
by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine
it with the :doc:`date<date>` filter for formatting.

Arguments
---------

* ``modifier``: The modifier

.. _`strtotime`: http://www.php.net/strtotime
.. _`DateTime`:  http://www.php.net/DateTime