I’m trying to convert Strings from a text reader to a date type using the “String to Date&Time” node. The format and type guessing function chooses d.M.yyyy as format and Date as type. Nevertheless, the node returns a type=extended<…> column, which does not match the input types of succeeding nodes. The content of the columns seems fine. Is there anything I’m doing wrong? How can I get a Date type out of this?
could you provide your String input or an example workflow?
Never had this kind of error
You could try with the string to date (legency) nodes instead as an alternative
Hi all,
so a very basic example is “1.6.2020”. I read it using a delimited text reader and now tried to convert this into a date type of format “yyyy-MM-dd”. Using a string to date (with format d.M.yyyy) produces the right content (so right format and validation e.g. for non-existing dates like 30.2.2019). Unfortunately, it returns a GenericObject type (can be seen by placing a type conversion after), which can’t be handled as a date type as expected.
Using the legacy String to Date node works fine, but results in a timestamp type, which I tried to avoid as there is no time in the data.
I found a workaround for this, namely to convert it back to String and use a type conversion. The workflow would be:
Reader -> String to Date&Time -> Date&Time to String -> Type conversion
This way, a date type is returned, but I doubt that this is the generally desired way.
Hi Simon,
yes this is the case, just like you explained. I use a company specific plugin, which also includes the Type conversion. Sorry, I missed that this was from a plugin.
I did some research on the plugin, and it was designed before the new String To Date&Time came out and not maintained after. So I guess this is the actual problem, as using the legacy node works. Thank you very much for your effort, but then the problem is not a general one, but related to the plugin.