Today's date from function node

Can anyone share a function node that can generate today’s date, without the time.

This one does the trick:

But I don’t know how to remove the time data.

Welcome to the community @Davey

I used a Date & Time node with an expression. Check the example below.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -100,
        280
      ]
    },
    {
      "parameters": {
        "value": "={{new Date()}}",
        "options": {}
      },
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 1,
      "position": [
        130,
        270
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
3 Likes

Beautiful, Thank You!

We’re working on allowing you to be able to use things like $today and $now in expressions. Hope to have some news on this soon :slight_smile:

1 Like