How to get time

Hello I am using date and time node with {{$now}} and format to HH:MM as i needed only time
but its taking 12:00 time see the attached screenshot


{
  "meta": {
    "instanceId": "e30b3258fcfbdb7b2363ece769dfadcb03733c16ccf3374d3028d818e30c8718"
  },
  "nodes": [
    {
      "parameters": {
        "value": "={{ $now }}",
        "custom": true,
        "toFormat": "hh:mm",
        "options": {}
      },
      "id": "61827737-a35e-42a6-81e3-d7cbcc1b0ca2",
      "name": "Date & Time1",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 1,
      "position": [
        520,
        680
      ]
    }
  ],
  "connections": {}
}```

Try a Set node, you can use an expression like:

{{ $now.toFormat("hh:mm") }}

1 Like

Try using new Date() as a value instead of now
Example: {{new Date().toISOString()}}

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.