cancel
Showing results for 
Search instead for 
Did you mean: 

mapping issue

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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:

http://www.saptechnical.com/Tips/XI/Date/Oracle.htm

Answers (3)

Answers (3)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sanjay,

        U can use standard date function Transformdate as shown in screen shot below

regards

Anupam

Former Member
0 Kudos

Hi Experts,

Thank you very much for your valuable inputs.

Thanks and Best Regards,

sanjay

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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.



Former Member
0 Kudos

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