n8n Workflow

Working With Dates And Times

This n8n workflow automates tasks and integrates with various services. Working With Dates And Times - ready to import and run in your n8n instance.

n8n workflow.json

About This Script

This n8n workflow automates tasks and integrates with various services. Working With Dates And Times - ready to import and run in your n8n instance.
Features:
  • Automates workflow tasks
  • Ready to import into n8n
  • Configurable parameters
Source Code
{
    "nodes": [
        {
            "name": "On clicking 'execute'",
            "type": "n8n-nodes-base.manualTrigger",
            "position": [
                1140,
                780
            ],
            "parameters": [],
            "typeVersion": 1,
            "id": "d0bb9f79-947b-4b26-8008-e6f440cf5445"
        },
        {
            "name": "Note",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1480,
                760
            ],
            "parameters": {
                "width": 560,
                "height": 400,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "471e0292-5b3e-436b-baca-dd50df534b0b"
        },
        {
            "name": "Note3",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                660,
                780
            ],
            "parameters": {
                "width": 420,
                "height": 100,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "2c09add2-3837-4985-8fd5-e67200b5b896"
        },
        {
            "name": "12 Hours from now",
            "type": "n8n-nodes-base.dateTime",
            "position": [
                1520,
                580
            ],
            "parameters": {
                "value": "={{$now}}",
                "action": "calculate",
                "options": [],
                "duration": 12,
                "timeUnit": "hours"
            },
            "typeVersion": 1,
            "id": "ce69e377-6574-41ca-8223-923b03dcf845"
        },
        {
            "name": "Note1",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1480,
                400
            ],
            "parameters": {
                "width": 560,
                "height": 340,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "4b8c6756-a1ea-4721-a665-953af6092ade"
        },
        {
            "name": "Note4",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1980,
                860
            ],
            "parameters": {
                "width": 480,
                "height": 320,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "146e0ed3-6c2b-4a40-9727-cf7670ff8730"
        },
        {
            "name": "Set times",
            "type": "n8n-nodes-base.set",
            "position": [
                1520,
                1020
            ],
            "parameters": {
                "values": {
                    "string": [
                        {
                            "name": "Now",
                            "value": "={{$now}}"
                        },
                        {
                            "name": "Current time with seconds",
                            "value": "={{$now.toLocaleString(DateTime.TIME_WITH_SECONDS)}}"
                        },
                        {
                            "name": "Today",
                            "value": "={{$today}}"
                        },
                        {
                            "name": "Tomorrow",
                            "value": "={{$today.plus({days: 1})}}"
                        },
                        {
                            "name": "One hour from now",
                            "value": "={{$now.minus({hours: 1})}}"
                        },
                        {
                            "name": "Weekday",
                            "value": "={{$today.weekdayLong}}"
                        }
                    ]
                },
                "options": []
            },
            "typeVersion": 1,
            "id": "eccc77b1-bad6-4a72-8433-a6a61a2053b2"
        },
        {
            "name": "Edit times",
            "type": "n8n-nodes-base.set",
            "position": [
                2080,
                1020
            ],
            "parameters": {
                "values": {
                    "string": [
                        {
                            "name": "Current time",
                            "value": "={{DateTime.fromISO($json[\"Now\"])}}"
                        },
                        {
                            "name": "Current time formatted",
                            "value": "={{DateTime.fromISO($json[\"Now\"]).toFormat('yyyy LLL dd')}}"
                        }
                    ]
                },
                "options": [],
                "keepOnlySet": true
            },
            "typeVersion": 1,
            "id": "c2b43ed0-6a49-46af-a2e9-9e7ee76ddea1"
        },
        {
            "name": "Format - MMMM DD YY",
            "type": "n8n-nodes-base.dateTime",
            "position": [
                1760,
                580
            ],
            "parameters": {
                "value": "={{$now}}",
                "options": [],
                "toFormat": "MMMM DD YYYY"
            },
            "typeVersion": 1,
            "id": "3221c06d-1cc5-4257-baf6-181435267e55"
        }
    ],
    "connections": {
        "Set times": {
            "main": [
                [
                    {
                        "node": "Edit times",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "12 Hours from now": {
            "main": [
                [
                    {
                        "node": "Format - MMMM DD YY",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "On clicking 'execute'": {
            "main": [
                [
                    {
                        "node": "Set times",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "12 Hours from now",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "n8n_version": "1.5.0"
}
Requirements
n8n instance, API credentials for connected services
Tags
#n8n #automation #workflow
Quick Actions
More in n8n Workflows