January 2002
Intermediate to advanced
264 pages
8h 3m
English
java.util.Date
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{ publicDate(); publicDate(long date); public longgetTime(); public voidsetTime(long time); public booleanequals(Object obj); public inthashCode(); }
Read now
Unlock full access