From 309fbdf0eeb8dc0b3cfe43f2687ce66cf0e4a71a Mon Sep 17 00:00:00 2001 From: krisn0x <10799186+krisn0x@users.noreply.github.com> Date: Sat, 10 Jan 2026 19:42:42 +0200 Subject: [PATCH] clarify DateTime() is recommended vs Date() (#4055) Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Kartik Balasubramanian <22399046+HumanistSerif@users.noreply.github.com> --- docs/code/cookbook/luxon.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/code/cookbook/luxon.md b/docs/code/cookbook/luxon.md index f3b77e5cc..a1829a446 100644 --- a/docs/code/cookbook/luxon.md +++ b/docs/code/cookbook/luxon.md @@ -22,6 +22,7 @@ Luxon is a JavaScript library. The two convenience [variables](#get-the-current- Be aware of the following: * In a workflow, n8n converts dates and times to strings between nodes. Keep this in mind when doing arithmetic on dates and times from other nodes. +* Using Luxon's `DateTime()` is the recommended approach in n8n. Using vanilla JavaScript's `Date()` doesn't work with some n8n features. For example, it doesn't respect the [Workflow-specific Time Zone](https://docs.n8n.io/workflows/settings/#timezone). * With vanilla JavaScript, you can convert a string to a date with `new Date('2019-06-23')`. In Luxon, you must use a function explicitly stating the format, such as `DateTime.fromISO('2019-06-23')` or `DateTime.fromFormat("23-06-2019", "dd-MM-yyyy")`. ## Setting the timezone in n8n