How can i add 3 days from the created date

Describe the issue/error/question

How can i add 3 days from the created date code like this {{new Date().toLocaleDateString(“sv”)}}

What is the error message (if any)?

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:
1 Like

i want to add 3 days more for this code

1 Like

Hey @H_nh_Nguy_n,

Have you checked this out?

https://docs.n8n.io/code-examples/expressions/luxon/#get-n-days-from-today

It should be a case of doing {{$today.plus({days: 3}).toLocaleString()}} but that depends on the version you are running which seems to be missing from the template.

You can also use the Date and Time node to add 3 days to the current date.

and just to be complete… A longer and slightly older method would be {{new Date(new Date().setDate(new Date().getDate() + 3)).toLocaleDateString()}}

The workflow below shows all 3 methods.

2 Likes

it works. thanks a lot for your support

2 Likes

hi @Jon , could you please kindly help me on this. I would like to set up mode with every year but i don’t know how to do it. Besides, i would like to set up mode 1 specific day for example on 27 Mar 2027 i want to create a task in todoist

Hey @H_nh_Nguy_n,

Are you after a yearly run or specifically a task that runs on March 27th in 2027? If you wanted to run a schedule on March 27th every year you could use something like 0 0 27 3 *. This site can be handy for working out cron expressions: https://crontab.guru

i have 2 tasks:

  1. i want to run specifically a task on March 27th in 2027
  2. i want to run a task yearly on March 27th >> 0 0 27 3 * i think number 3 should be replace by 2 right?
    image
    how can i set the due string that this task will be created in Todoist on Jan 5th every year? because i don’t want up to 27 March every year the task is created. I need it be created sooner with specific date

Ah yeah I forgot we use 6 fields… Try 0 0 0 27 3 * that should do the job but the only bit you can’t do is specify which year so what you would need to do is use an If statement to check the current year and if it isn’t 2027 stop the task.

With the Todoist part are you wanting to create a task that is due on Jan 5th on March 27th or create a task on Jan 5th that is due March 27th like for UK tax returns or something?

i want to create a task on Jan 5th that is due March 27th

Ah yeah I forgot we use 6 fields… Try 0 0 0 27 3 * that should do the job but the only bit you can’t do is specify which year so what you would need to do is use an If statement to check the current year and if it isn’t 2027 stop the task.

could you show me how to do this?
Try 0 0 0 27 3 * it seems number 3 is Apr

Ah yeah, I failed to read our own prompt. January would be 0 so you are correct the 3 would be 4.

For the due date try something like this…

and then where i should put Set in your picture into my setup?



Between the Cron node and the todoist node.

normally i creat cron node is due date of that task, todoist due string is created date. if using Set node between, is it ok?

You lost me there buddy, The Cron node would be the schedule to run the workflow on so it would be the trigger node for the workflow.

Once it has started you can put anything you want after it, In theory you could just set the Due date in the Todoist node to the expression used in the Set node then you can just have the 2 Cron and Todoist nodes.

Ah, i got your idea. Previously i made reversely. Let me try as you guide.

1 Like

I’ve tried, created task is not worked automatically with the time set up 1st Jun at 10:30, it just work when i click “Execute node”. Besides, the task created doesn’t include due date. Could you please guide me more




Hey @H_nh_Nguy_n,

I would remove the expression from the cron node as it isn’t needed and make sure you enabled the workflow and that n8n was running still when the schedule was meant to occur.

In your todoist node I can’t see where you have set the due date field so I suspect it could just be where it isn’t set, Give the one below a go.

It doesnt allow me to enter the code, it just let me pick up the date


Hey @H_nh_Nguy_n,

You can copy / paste the example provided or if you click on the little cog icon it will give you an option to add an expression.