One Star

How to add days in a date

Hi,
I am new to talend and figuring out how to add 10 days to a date coming from the source in Tmap.
3 REPLIES
Community Manager

Re: How to add days in a date

Hello Sheffy Gupta
what are your really expected result? Can you take an example?
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: How to add days in a date

Hi,
you have to convert your date in a Calender. You can found some more information and examples here:
Java API
Examples
Bye
Volker
One Star

Re: How to add days in a date

Hello,
You can create this routine :

public static java.util.Date add_a_day(java.util.Date ref_date) {

java.util.Calendar cal1 = java.util.Calendar.getInstance();
cal1.setTime(ref_date);
java.util.Date date_out;
cal1.add(java.util.Calendar.DAY_OF_MONTH, 10);
date_out = cal1.getTime();
return date_out ;

}
}

José