on 2018 Nov 07 3:21 AM
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 !
Hello Arnab,
Instead of ff use SSSSSS it should work.
Regards,
Sri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Arnab,
I could see uou are using custom function for date transformation,,could you please try with standard date function available in message mapping which is very handy i guess and it will work for sure.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.