Hi Experts, I need to change the date format from
yyyy-MM-dd HH:mm:ss to yyyy-MM-ddT00:00:00:0000000Z
I tried the groovy script , but just not able to handle the last 8 digits
******************************************************************************************
import com.sap.it.api.mapping.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; //Add MappingContext as an additional argument to read or set Headers and properties. def String customFunc(String arg1){ //Date inputDate_parsed=new SimpleDateFormat("dd.MM.yyyy").parse(arg1); Date inputDate_parsed=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(arg1); DateFormat dateFormat_required = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:z"); def converted_datetime=dateFormat_required.format(inputDate_parsed); return converted_datetime; }
******************************************************************************************
Experts , can you please help quickly - what am I doing wrong !