String to Date&Time does not recognize format

I checked already several posts here about this issue, but I can’t get it working.

I have a date in the form of
21 Apr 2022:18:00:19 +0200

and a format string of
dd MMM yyyy:HH:mm:ss [ZZZ]

I am always gettting this error
ERROR String to Date&Time 3:45 Execute failed: Failed to parse date in row 'Row0': Text '21 Apr 2022:18:00:19 +0200' could not be parsed at index 3

What I am doing wrong?

Below I attach scren shots from what I tried.


I think you need to replace the hyphens with spaces in your workflow. When I copy and paste directly from your post, it works for me - but that’s not what you have present in the screenshot.

EDIT: now that I test a bit more, I see you are using a different locale. Mine is en-US by default, where you are using de-AT. So try changing that as well.

1 Like

Hi @kludikovsky,
as @ScottF mentioned you missed the hyphens in the example and check also the Locale.

Your formatting works exactly as he should.

2 Likes

Thank @ScottF , @eamendola
I confirm, it’s been the Locale. After changing it to en-US it worked.
It’s solved for me.

but just for understanding:
My machine ist running with Locale set to de-AT.
So isn’t a bug, if I need to change it from my standard environment?

Sorry to be back again.

What ist the difference between those two Nodes.
Node 45 is the node which was used in the above example, which finally worked, where I only reassigned the connection and changed the field.

Node 41 is the original node I started struggling with.

One works one doesn’t.

Just für completeness, the error message is
ERROR String to Date&Time 3:41 Execute failed: Failed to parse date in row 'Row51386': Text '21 Apr 2022:18:00:19 +0200' could not be parsed at index 3

It’s just for understanding, or is it a bug?


In this case I don’t believe it’s a bug, since the locale refers to the format of the data itself, not the locale associated with your machine.

In your first screenshot, I believe there are two issues. One is the locale is set to es-US, which fails (as expected) since your data is in English date format, not Spanish.

The second issue is a warning in the dialog, about needing a time zone or offset. This is because you have brackets around ZZZ, which indicates an optional offset. If you remove those brackets, the dialog won’t give you warnings anymore, since it will expect an offset is always there (and will fail if there is not).

In the second screenshot, I couldn’t duplicate the failure. en-US locale works for me, and the warning message is effectively ignored when you execute the node, and you get valid results since an offset exists.

Hope that helps. This node can be a bit tricky at first :slight_smile:

2 Likes

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