Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to this month data from csv to csv using tfilter.
now Date format MM-DD-YYYY in csv, and talend batch run next day.
How can I compare (current day -1)month and MM-DD-YYYY data?
sorry for short message question.
thanks.
Miki
java.util.Date mydate=TalendDate.getCurrentDate();
int year=TalendDate.getPartOfDate("YEAR",mydate);
int month=TalendDate.getPartOfDate("MONTH",mydate)+1;
String months=String.valueOf(month);
if(months.length()==1){
months="0"+months;
}
java.util.Date currentMonth=TalendDate.parseDate("yyyy-MM-dd", year+"-"+months+"-"+"01");
globalMap.put("currentMonth",currentMonth);
TalendDate.compareDate(input_row.dateColumn, (java.util.Date)globalMap.get("currentMonth")
TalendDate.compareDate(input_row.Date,(java.util.Date)globalMap.get("currentMonth"))>=0