Name

java.util.Date

Synopsis

The Date class is a smaller version of its J2SE counterpart. It represents an instance in time, specified as the number of milliseconds since the epoch (midnight GMT, January 1, 1970). To create a Date object that represents the current system time, do the following:

Date currentDate = new Date();

This is equivalent to:

Date currentDate = new Date(System.currentTimeMillis());

You can also access the date and time represented by this object with the getTime() and setTime() methods.

public classDate {
   public Date();
   public Date(long date);

   public long getTime();
   public void setTime(long time);
   public boolean equals(Object obj);
   public int hashCode();
}

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.