Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Gurus,
I am new to Talend Integration. Need your help to resolve one of Development issues. I have two columns TRDNG_DT and DLVRY_DT. I will have to count number of months between the dates. For Example, Field TRDNG_DT = 14.11.2019 and DLVRY_DT = 01.04.2020. First, I will have to set the TRDNG_DT set to 01.11.2019 and then start count the number of months and load into Target field. I can able to capture number of days but how-to capture the months.
Please let me know.
Thanks,
Nag
Use builtin function TalendDate.dateDiff
Date date1 = new SimpleDateFormat("dd.MM.yyyy").parse("14.11.2019"); Date date2 = new SimpleDateFormat("dd.MM.yyyy").parse("01.11.2019"); System.out.println(TalendDate.diffDate(date1, date2,"MM")); //0 months
Use builtin function TalendDate.dateDiff
Date date1 = new SimpleDateFormat("dd.MM.yyyy").parse("14.11.2019"); Date date2 = new SimpleDateFormat("dd.MM.yyyy").parse("01.11.2019"); System.out.println(TalendDate.diffDate(date1, date2,"MM")); //0 months
Hello Evansdar, thanks for your prompt solution