java.util.Date doesn't have explicit methods for adding days, months, years, etc. However you can indirectly accomplish these operations through the java.util.Calendar class:
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.YEAR, 3);
Date applicationDate = calendar.getTime();
This example gets the current date (aka SYSDATE) then adds 3 years to it; then assigns it to applicationDate variable.
If you already have an existing Date object, just get a Calendar instance then call:
setTime(Date date)
function =A=
No comments:
Post a Comment