I am currently testing out n8n in order to verify if its suitable for company use. It needs to send data with a Salesforce node. The problem is, that since the Winter time in germany, the date sent to salesforce is off.
I need to send a date which should be correctly: (mm.dd.yyyy hh:mm) 23.12.2024 08:00
The “Ankunftstermin” is supposedly sent as “2024-12-23T07:00:00.000+0000”.
Which seems to be correct, since the timezone will be handled in Salesforce.
I tried with “2024-12-23T07:00:00.000Z” too, as seen in the “Abholtermin” with no changes to the problem.
The salesforce TZ is set to Europe/Berlin aswell as the N8n workflow.
The time now appears as 23.12.2024 09:00 in salesforce. After contacting salesforce and trying to find out if the issues is on their end, they denied and proved me wrong.
Since i can send the exact same date string (2024-12-23T07:00:00.000+0000 ( or with Z) )
via a HTTP Request client and it appears correctly in Salesforce.
I suspect n8n to modify my date now.
What can I do to debug this more and make it clear to gather some help?
It seems to somewhat specific to timezones, but changing the timezone in n8n doesnt help either. Salesforce inserts the date sent with one hour off already, resulting in +2 hours in the UI then (Since my UI is set to gmt+1 germany). But that shouldnt be the case as mentionen with the HTTP Request done manually sending the same data.
Unfortunately, sharing the whole Workflow is not possible and hopefully not necessary.
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
n8n manages two types of timezone controlled by two corresponding environmental variables, namely
GENERIC_TIMEZONE: to control time for the triggers and crons
Moreover, each workflow could have its own timezone set via workflow settings (meaning it will override TZ set during deployment or the default value if not used). This controls how the n8n variables such as $now and $today present the datetime values.
When you use Date() the date string is converted to the timezone set in your system where you host n8n. It also depends on the string representation of the date you are casting to Date object (whether it includes timezone or not).
See how the time changes depending on differemt conditions.