6 Replies Latest reply: Mar 24, 2008 7:34 AM by 807601 RSS

    How can I return the current Date in Java?

    807601
      I am new to Java, and basically I want to know how I can return the current date as a variable, so for example, I have declared the following date variable
      private java.util.Date currentDate;
      How can I return the current date, do I have to write a method? To be more specific, I need to write a setMethod, that simply returns the current Date in Java.

      Please point me in the right direction.
      Thanks,