on 01-24-2009 7:16 AM
Hi Friends,
I would be getting the date format in yyyyMMdd and i have to display it in dd-MMM-yyyy.
I could not see suck option in 'date trans' function.
Could some one shed somelight on this.
In Date Function, Select DateTrans --->Properties.
The Formats of Source and Target Date are editable and allows to manually enter the required format. Format of Source Date : select and edit to yyyyMMdd and Format of Target Date : select and edit to dd-MMM-yyyy. Now test in the Test Tab in MM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi...
You can get the output format of your date by using the DateTrans function.
Do as specified by Venkateswarulu.
Regards,
Leela
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public String dateFormat(String date, Container container) { // date = yyyyMMdd convert to dd-MMM-yyyy
if (date.length() > 0 ) {
String [] month = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"};
char charArray[] = date.toCharArray();
StringBuffer targetDate = new StringBuffer();
targetDate.append(date.substring(6));
targetDate.append("-");
targetDate.append(month[Integer.parseInt(date.copyValueOfcharArray,4,2),10) - 1]);
targetDate.append("-");
targetDate.append( date.substring(0,4));
return targetDate.toString();
}
return "";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create the Simple UDF and use the below code:
public String dateFormat(String date, Container container) { // date = yyyyMMdd convert to dd-MMM-yyyy
if (date.length() > 0 ) {
String [] month = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"};
char charArray[] = date.toCharArray();
StringBuffer targetDate = new StringBuffer();
targetDate.append(date.substring(6));
targetDate.append("-");
targetDate.append(month[Integer.parseInt(date.copyValueOf(charArray,4,2),10) - 1]);
targetDate.append("-");
targetDate.append( date.substring(0,4));
return targetDate.toString();
}
return "";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can maually enter date format of u r Source and Target using Datetran Standard Fuction
Just Type
yyyyMMdd --- > dd-MMM-yyyy.
it will work
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess dateTrans should solve your problem. Are you checking for the possibilities in drop down? Try to manually input the source and target format and test it.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.