Functions › date

Table of Contents

← functions

Converts an argument to a date to allow date comparison:

{% if date(user.created_at) < date({days: -2}) %}
    {# do something #}
{% endif %}

The argument must be in one supported parsable date and time formats. or date and time interval

If no argument is passed, the function returns the current date:

{% if date(user.created_at) < date() %}
    {# always! #}
{% endif %}