Modify Time Zone Node the Shift Timezone option does not adjust time

No matter how the node is configured it never adjusts the time.

From the Node’s description:

Shift time zone

Shifts the time zone in zoned date&time columns by adjusting the time (and potentially date) according to the new time zone offset.
Note: If you want to shift the time zone of a local date&time column, you first need to set the current time zone, e.g. UTC, with a separate node and then shift it to the wished time zone.

But even if the Shift Timezone option is active, nothing happens to the time part of the cell value. It’s only the timezone that changes.

Sample workflow attached.
Timezone Set vs Shift.knwf (20.2 KB)
KNIME Analytics Platform 4.3.2

I’ve elaborated this a bit more. Now it seems to me it could have something to do with milliseconds.

Hi @jan_lender , in order to shift a timezone, the node need to know what the input timezone is. So it only works if you have a zoned datetime. In your example, though you named the column as zoned_datetime, it’s not really a zoned datetime. If you have the correct zoned datetime, it works.

Here’s a quick example:
First, I get the current datetime with timezone like this:

And this is the format it produces:

I shift the timezone to UTC, and here’s the result:

You can see that the time has shifted 4 hours ahead in UTC.

EDIT: BTW, it works in your workflow too:

Basically, the Prague one would not work because as I said, the input time did not have a timezone. But after you set the timezone to Prague, and then shift the Prague zoned time to NY, it shifted the time from Prague to NY as pointed out in the red boxes, and so on further ahead in your workflow


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