Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to convert a string field from tExtractJSONFields to a date.
The expression in tMap is TalendDate.parseDate("yyyy-MM-dd hh:mm:ss",row4.Date).
Here is the error:
Caused by: java.text.ParseException: Unparseable date: "["2020-03-09 15:21:53"]"
The output column is DATE type, formatted "yyyy-MM-dd HH:mm:ss".
Please Help!
Thanks for the reply @manodwhb. The expression is the same and the target data type is Date and date pattern is "yyyy-MM-dd HH:mm:ss". I am still getting the same unparsable date error.
I did a test where I changed the target field as string and removed the expression. It's logging as ["2020-03-26 15:30:55"]
Do I need to replace the brackets and double quotes before the expression TalendDate.parseDate("yyyy-MM-dd hh:mm:ss",row4.Date)?
@EdithM , the below expression working well. you need to check expression and data types of the target once.
TalendDate.parseDate("yyyy-MM-dd hh:mm:ss",row4.Date)
Thanks for the reply @manodwhb. The expression is the same and the target data type is Date and date pattern is "yyyy-MM-dd HH:mm:ss". I am still getting the same unparsable date error.
I did a test where I changed the target field as string and removed the expression. It's logging as ["2020-03-26 15:30:55"]
Do I need to replace the brackets and double quotes before the expression TalendDate.parseDate("yyyy-MM-dd hh:mm:ss",row4.Date)?
@EdithM , yes you need to remove [" and ]" ,and then convert it will work.