It looks like you need to add a variable to hold the new value and then
reference that variable.  As it is.. you're just referencing the object
DATE.
I could be wrong though. <grin>

??Darrin Blocker
Faculty Patient Business Office
Report Analyst
[EMAIL PROTECTED]
(909) 824-0800 x.33924

 -----Original Message-----
From:   Alireza Nahavandi [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, June 05, 2002 13:07
To:     [EMAIL PROTECTED]
Subject:        Date calculation

Hi all,

I want to get the date of 5 days later. According to Sun Java document, the
following code should work. But still the result is today.
Am I missing anything?



    Calendar myCal = Calendar.getInstance();
    myCal.add(myCal.DATE, 5);

    System.out.println ( myCal.DATE );


Confidentiality Note: The preceding e-mail message (including any
attachments) contains information that may be confidential, protected by
applicable legal privileges, or constitute non-public information.  It is
intended to be conveyed only to the designated recipient(s).  If you are not
an intended recipient of this message, please notify the sender by replying
to this message and then delete it from your system.  Use, dissemination,
distribution or reproduction of this message by unintended recipients is not
authorized and may be unlawful.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to