Date & Time still broken: Timezone not always working

For some date formats, the Workflow Timezone just not working.

Check out this example.
In the upper branch checking/unchecking gives different results (as expected)
In the bottom node checking/unchecking gives nothing

Hi @artildo, I am not sure I fully understand the problem.

Both branches in your example use the timestamp value produced by the initial Schedule node in your example, returning my local time of 2023-07-05T11:42:43.641+02:00 when I was executing this:

My workflow uses the default time zone of my instance (Europe/Berlin), so this value is correct. The upper branch, first converting this into unix time using your “Date & Time - Unix” node eventually produces the same timestamp using the desired formatting on your “Date & Time - date format1” node:

The lower branch subtracts six hours on the “Date & Time - substract” node and the “Date & Time - date format” returns a value 6 hours before 11:42 formatted as expected:

So this seems to work for me on [email protected]. Can you confirm which values you would expect instead in the example above?

Perhaps you simply want to use a Luxon expression to format your dates in the correct time zone? This might be much simpler, check out this post for an example.

@MutedJam Thank you for going deep

I’m on the last n8n version up to date. The problem is:

  1. In upper node (date format 1) switching the timezone gives different results (as it should be). So it gives UTC and local times.
  2. In the bottom node (date format) switching the timezone gives NOTHING. It produces UTC and UTC. Not UTC and local.

That shouldn’t be like that. And the only difference in these two nodes is the date format they receive:

Switch is OFF:

Switch is ON (nothing happens, I expect to add +6 hours for my local time)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.