One Star

Bug in Talend.addDate

Hi,
I'm getting the following bug using addDate, code:
System.out.println("start date: "+context.startDate);
context.endDate = ((String)TalendDate.addDate(context.startDate,"yyyy-mm-dd",1,"mm"));
System.out.println("calc 1: "+context.endDate);
context.endDate = ((String)TalendDate.addDate(context.endDate,"yyyy-mm-dd",-1,"dd"));
System.out.println("calc 2:"+ context.endDate);

Output:
start date: 2009-08-01
calc 1: 2009-09-01
calc 2:2008-09-31
2 REPLIES
One Star

Re: Bug in Talend.addDate

(oops, forgot to login now I can't edit it)
Any one else with this problem?
Thanks,
Vitor Lopes
Community Manager

Re: Bug in Talend.addDate

Hello
Change the date pattern to :
"yyyy-MM-dd"
In Talend,
MM means months in year.
mm means minutes in hour.
Best regards

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