Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table column with char data type and below is the value. Now I need to convert this to a date data type. I am trying to use TalendDate.parseDate and TalendDate.formatDate combination to achieve this. Can you please help how to get this done? Appreciate the help!
Source Value - 2020-04-12-23.43.00.013342
Code trying to use:
TalendDate.parseDate("yyyy-MM-dd-HH.mm.ss.ssssss",row7.OPPORTUNITYID.trim())
Hi Manohar,
let me put it this way.
i have a column as char data type with value "2020-04-12-23.43.00.013342" on it.
Now i need to convert this to DATE datatype by keeping the same format of the value.
please let me know how this can be done.
I stand corrected that my source format is actually string not char. I used below command.
source - 2020-04-12-23.43.00.013342
TalendDate.parseDateInUTC("yyyy-MM-dd-HH.mm.ss.ssssss",row7.OPPORTUNITYID)
output - 2020-04-12-23.25.22.000022
tMap output definition.
i am not sure why mm.ss.ssssss part is getting changed.
Hi Prabav, I am also facing same issue mm.ss.ssssss part is getting changed. Have you resolved this issue?
Hi , the java Time class don't support nanosecond.
the max you can use is for millisecond.
You can use the LocalDateTime class instead
Send me Love and Kudos