How to add days in a date

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.
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
Highlighted
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é

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download