AnsweredAssumed Answered

Not returning week when used in Map function?

Question asked by priyankas9531 on Jul 16, 2015
Latest reply on Jul 28, 2015 by priyankas9531
Hi,
Can someone help me and let me know why the below script is not returning me the week when i am using it in the map function? The same script is running fine and retruning 23 when i am running it in the groovy webconsole.

I have tried to pass both string and date field as input and output week1 and PS are Number field in the map csv profile

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Properties;
import com.boomi.execution.ExecutionUtil;

String input = "20150601";

SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
Date date1 = df.parse(input);

Calendar cal = Calendar.getInstance();
cal.setTime(date1);
int week1 = cal.get(Calendar.WEEK_OF_YEAR);
int PS = week1;
return PS;

Outcomes