IF time check

Hi!

How could I implement an IF node which returns TRUE IF the current local time is between 08:00 and 18:00 and FALSE if any other time?

Thanks.

You can use an expression like this:

{{ new Date().getHours() }}

A possible IF-Node:

{
  "nodes": [
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{new Date().getHours()}}",
              "operation": "largerEqual",
              "value2": 8
            },
            {
              "value1": "={{new Date().getHours()}}",
              "value2": 18
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        500,
        322
      ]
    }
  ],
  "connections": {}
}

Great thank you!

Happy if it helped. Have fun!