如何在树枝上获得时间?

问题描述

enter image description here

早上好..我不想添加类似{%的条件,如果时间> 18 H且时间

我不知道该如何打发时间?

解决方法

您可以这样做:

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

如果您正在谈论当前时间。