如何在树枝中获取时间?

How to get Time in twig?

enter image description here

早上好..我想添加一个条件,例如{% if time > 18 H and time < 22 H %} 付款人 {%endif%}

我不知道如何在 twig 中获取时间??

你可以这样做:

{% if 'now'|date("H") > 18 and 'now'|date("H") < 22 %}

如果你说的是当前时间。