String to Date returns genericObject instead of Date

Hello,

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?

Thanks for any help in advance.
Best regards

Hi @C4st1el,

could you provide your String input or an example workflow?
Never had this kind of error :confused:
You could try with the string to date (legency) nodes instead as an alternative

Hi @C4st1el,

I would also be very interested in your workflow or at least some screenshots. I am happy to investigate and help!

Cheers,
Simon

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.

Best regards

Would you be able to share a small workflow? I am not able to reproduce it, unfortunately. What do you mean with type conversion?

The String to Date&Time node should output in your case such a column:
image
The calendar implies that it’s a date column. If you go to the Spec tab, you should see a Local Date column:
image

This is not the case for you?

Simon

3 Likes

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.

Best regards

3 Likes

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