Skip to Content
avatar image
Former Member

Date Calculation

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Nov 09, 2005 at 08:49 PM

    Hi Duke,

    import java.text.*

    http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html

    Regards

    Anand

    Add comment
    10|10000 characters needed characters exceeded