String to Date&Time Node

Hello,

New user trying to fix an issue with the String to Time&Date node.

The workflow I've set up creates a CSV file.

I am enhancing this workflow to write directly to our PG Database, but the date values passed in one of my columns is a string. When I try to use the String to Date&Time node to convert the string to a date I receive the following error.

"ERROR String to Date&Time  0:239      Execute failed: Failed to parse date in row 'Row0: Text '11/9/2017' could not be parsed at index 2"

I appreciate any feedback.

Hi,

which format did you use for the conversion?

Should be either M/d/yyyy or d/M/yyyy 

Best, Iris 

When I use m/d/yyyy, the error message reads "ERROR String to Date&Time  2:2        Execute failed: Failed to parse date in row 'Row0: Text '11/9/2017' could not be parsed: Unable to obtain LocalDate from TemporalAccessor: {DayOfMonth=9, MinuteOfHour=11, Year=2017},ISO of type java.time.format.Parsed"

"m" is the pattern for minutes but not months. For months you have to use "M". The list of all patterns is linked in the node description.

2 Likes

thank you Thor

I capitalized the m but received the same error except  "MinuteOfHour" was replaced by MonthOfYear.

Well, d/M/yyyy works for me when parsing your example 11/9/2017. Is it complaining about the same row?

I was to execute the node properly with M/d/yyyy format.

Thank you!

 

1 Like

I tried an example on my system And found that capitalising the “M” to denote that it is a month and not minutes.