cancel
Showing results for 
Search instead for 
Did you mean: 

Date format

Former Member
0 Kudos

Hello Every One

I would be getting the date format in yyyyMMdd and i have to display it in dd-MMM-yyyy.

I used date trans function to acive this, now i am getting required format.  but i wanted the month to be displayed in caps.

For example the date is 19-Sep-2012 i want it like 19-SEP-2012

I have used To UpperCase function to achive this. The Problem is when i test it in message mapping time it is coming fine, but in the target file it is still coming 19-Sep-2012.

it is a CSV file.

Can any one tell me what could have gone wrong.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi,

It might be silly, but... Did you save & activate your change? There shouldn't be any difference between mapping test and real message mapping, in terms of results of the functions you mentioned.

Regards,

Greg

Former Member
0 Kudos

Hi Greg,

Thanks for your help,

Just now i have realized that. the CSV file when opened using notepad is fine, I mean Date is being displayed 19-SEP-2012 but if t is opened with Xcel sheet it is showin like 19-Sep-2012.

Can you please let me know what could be the reason.

Regards,

former_member184681
Active Contributor
0 Kudos

I think that's because of the way how Excel works and how it displays dates. If you need to influence that - you should rather ask MS Office/Excel gurus, not PI ones .

As you said, the file opened in Notepad is correct, so PI works as you expect.

Regards,

Greg

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sridhar,

                  The excel does not allow date to be shown in capital letters unless you write a small function to display the same. Say for example the date appears in excel cell a1. Then in the cell where you want it to be displayed in capital you need to write this function =UPPER(TEXT(A1,"dd-mmm-yyyy")).  Below are the screen shot

In case you want to view the output only in excel and no other editor you can use this UDF just before populating the date field in target xml

public static String capitalDate(String date)

{

              return "=UPPER(\""+date+"\")";

}

If you view the output in notepad you will get

in excel it will look like

regards

Anupam