Skip to Content
0
Former Member
Nov 09, 2005 at 08:34 PM

Date Calculation

51 Views

Hi,

I'm trying to create a user function to calculate a date where start date + 40 days.

Start date is the input to the user funciton.

The function consists of the following code:

<i>

Calendar calendar = Calendar.getInstance(); 
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
Date date = dateFormat.parse(startDate); 
calendar.setTime(date);
calendar.add(Calendar.DATE, 40);
String endDate = calendar.toString();
return endDate;

</i>

I get the error messages, "cannot resolve symbol symbol : class DateFormat" and "cannot resolve symbol symbol : class SimpleDateFormat".

Are there imports I need to reference? Is there another way to do the above?

Any help would be greatly appreciated.

Thanks.

Best Regards,

Duke