-2

enter image description here

Good Morning .. I want t add a condition like {% if time > 18 H and time < 22 H %} Payer {%endif%}

I don't know how can i get the time in twig ??

1 Answers1

2

You can do it like this:

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

If you're talking about current time.

Marfee
  • 169
  • 7