cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting dates in a table in webdynpro java for mutliple entries.

Former Member
0 Kudos

Hi all,

I have a requirement to format date values in a table for multiple entries to dd/MM/yyyy format in webdynpro java for mutiple line items in that table.

Please help me out with the technique for the same.

Thanks and Regards,

Soumyadeep.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

here is the code for changing the formatting the date.

Date currentDate = new Date ();

DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);

String today = df.format(currentDate);

SimpleDateFormat sdfInput = new SimpleDateFormat("dd/mm/yyyy");

SimpleDateFormat sdfOutput = new SimpleDateFormat ("mm/dd/yyyy");

try {

String dateft = sdfOutput.format((Date) sdfInput.parse(df.format(currentDate)));

} catch (ParseException e) {

}

Former Member
0 Kudos

Thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use DateFormat for formatting the dates as per your requirement.

Cheers,

Arafat

Former Member
0 Kudos

Hi,

Thanks for your reply. I am doing as you say so but I need to do it for multiple rows in a table.

Please help me solve teh problem.

Regards,

Soumyadeep.

Former Member
0 Kudos

Hi,

You need to loop through all the rows of the table and format the dates as per your requirement.

Cheers,

Arafat