on 04-01-2012 6:07 PM
Hi Experts,
I am new to PI, i have a requirement to convert date from yyyy-MM-dd to dd-MON-yyyy format. its like basic question but i dont know how to handle this.could you help out this.
Example : 2012-01-18 this data is converts to 18-jan-2012. Please could you post sample code of udf or
how to handle in mapping by using standard functions?
Thanks and Best Regards,
sanjay.
PI, i have a requirement to convert date from yyyy-MM-dd to dd-MON-yyyy format. its like basic question but i dont know how to handle this.could you help out this.
Example : 2012-01-18 this data is converts to 18-jan-2012. Please could you post sample code of udf or
how to handle in mapping by using standard functions?
.................
Pls refer below link as explained same pro:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This can be done using standard datetrans function I guess. If you want UDF the following 5 lines of code and import statements.
Create UDF with your desired name and pass the input date as string parameter and this method will return the output date string as desired.
import java.util.Date;
import java.text.SimpleDateFormat;
String inputDate = inputDateString;
SimpleDateFormat format1 = new SimpleDateFormat("
yyyy-MM-dd");
SimpleDateFormat format2 = new SimpleDateFormat("dd-MMM-yyyy");
Date date = format1.parse(inputDate);
return format2.format(date);
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sanjay,
You can use Standard DateTrans function to achieve this, just give the input and output date format required.
Refer this link for your help
http://www.saptechnical.com/Tips/XI/Date/Conversion.htm
hope this helps,
Ankit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.