Date & Time conversion

Hi,

need help to convert a date&time field read from a database to a KNIME date&time field.
Unfortunately the format differs (3 digits of milliseconds) and I am unable to put that into one single command.

Example:
|RowID|time_established|
|Row13|2020-04-28T10:52:11.699Z|
|Row14|2021-01-16T07:25:28.077303Z|

I am using 2 separate "Strang to Date&Time"nodes, one converts the 3 digit value, the other the 6 digit value.
yyyy-MM-dd’T’HH:mm[:ss[.SSS]]VV[’[‘zzzz’]’]
yyyy-MM-dd’T’HH:mm[:ss[.SSSSSS]]VV[’[‘zzzz’]’]

Then I use “Column Merger” to combine the 2 resulting columns into one.

There must be an easier way. but something like
yyyy-MM-dd’T’HH:mm[:ss[.SSS[SSS]]]VV[’[‘zzzz’]’]
does not work at all

Anybody more familiar than me who can please support?
Thank you!
Jürgen

Found a solution after playing, researching articles and playing more:
yyyy-MM-dd’T’HH:mm[:ss[.SSSSSS][.SSS]]VV[’[‘zzzz’]’]

Easy if you understand what you are doing :slight_smile:

6 Likes

The syntax of the Date&Time conversion can be a little daunting at first. Thanks for posting your solution!

2 Likes

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