n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.04k stars 7.4k forks source link

DateTimeString.toDateTime().toISO() returns wrong time in string #11513

Open nepomuc opened 2 hours ago

nepomuc commented 2 hours ago

Bug Description

Having a string e.g. "8.8.22 14:35:06" where the time is related to timezone "Europe/Berlin" in the preview of the evaluated expression the result is correct but when executing the node it's not correct anymore: image I also tried to set the timezone right after .toDateTime() but this changed nothing.

To Reproduce

  1. Create a Set node with a string value "8.8.22 14:35:06" for the datetime string
  2. Use the expression DateTimeString DateTimeString.toDateTime().toISO() to create the ISO datetime string.
  3. See that the expression evaluation preview shows the correct string, while when executing the node is produces another string with an incorrect time.

Expected behavior

Return the correct DateTime string.

Operating System

Ubuntu

n8n Version

1.65.2

Node.js Version

Latest Docker image

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 2 hours ago

Hey @nepomuc,

We have created an internal ticket to look into this which we will be tracking as "GHC-377"