I have a string column with a value of 2/25/2020 and need to convert it to datetime. I use the node String to DateTime and give it the format of MM/dd/YYYY but it gives me an error. What format string is to be used when the month has a single digit?
In string to Date node I list column form as MM/dd/YYYY but it fails giving error as ERROR String to Date&Time 19:2 Execute failed: Failed to parse date in row 'Row0: Text â2/10/2020â could not be parsed at index 0
I guess MM/dd/YYYY doesnât seem to work even if I append a 0 to string. Also choosing guess data type and format doesnât seem to work.
Check the node description panel on the right hand side of your screen for more info on the the syntax (M = month, y = year, etc) - you might have to scroll down to see all the details. As you have already surmised, the format options are case sensitive, so you have to be careful.
As @izaychik63 pointed out, the âGuess data type and formatâ button is there, but it will only work for formats that it knows about. So, now that you have provided a new format by manually typing it in, it should be able to guess that properly when you configure the node in the future.