Skip to Content

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

date setting in webdynpro

hello

i have a from date and to date field

i have to set the to date as (current date) default

and the from date to (current date - 7 days) default

how do i code for this in webdynpro java.

Former Member
Former Member replied

Hi rohan,

In poojith's reply he is subtracting 72460*60 to get to 7 days old date.

For one month, replace 7 by 30 and for 1 year replace 7 by 365.

java.sql.date dtToDate = new Date(System.currentTimeMillis());

java.sql.date dtTempDate = dtToDate - (72460*60);// 7 days before

java.sql.date dtTempDate = dtToDate - (302460*60);// 1 month before

java.sql.date dtTempDate = dtToDate - (3652460*60);// 1 year before

java.sql.date dtFromDate = new Date(dtTempDate);

Best regards,

Sangeeta

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