Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a string "20200000000000" and I want to convert this to a Date (timestamp). Can you please help me?
I found the solution.
I converted the "2.02E+19" to BigDecimal. After I converted it toPlainString() and the I parsed this Plain String to .parseDate.
Looking at the string "20200000000000", the most suitable time format would be "yyyyMMddHHmmss".
Use TalendDate.parseDate("yyyyMMddHHmmss", "20200000000000") in a column with output as date data type.
Thanks a lot but I have one more question . If we have a column with different string dates for example "202000000" on the first row, "2301023010" on the second .
@karthikj18 It shows me error.
Basically this happens because the values are strings but they are "2.02.E+13" .How to convert them?
Looks like you are reading excel data. "2.02.E+13" usually a formatted date format in Excel. Check if this is the scenario, correct it in source component itself by giving proper date format in schema. Also catch the rejected records based on schema data type.
I found the solution.
I converted the "2.02E+19" to BigDecimal. After I converted it toPlainString() and the I parsed this Plain String to .parseDate.