Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dispalying future date in a webdynpro Iview

Hello Everyone,

In my web dynpro application after I save details. The saved details should be shows as valid as the monday following the date when details were saved.

Eg

sun 1-mo 2 tue 3 wed 4 thu 5 fri 6 sat 7

The validity date should be mon 9 .

Need your expert suggestions on how to capture the system date and dispalying in valid US format for next monday.

Thanks,

Boiler.

Former Member
Former Member replied

Hi,

try this to get the next monday from the current date,

SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");

Date dt = new Date(Calendar.getInstance().getTimeInMillis());

Calendar cal = Calendar.getInstance();

cal.setTime(dt);

cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);

cal.add(Calendar.DATE,7);

dateFormatter.format(dt); // current date

dateFormatter.format(cal.getTime()); // next monday

Regards,

ramesh

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question