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
{ publicDate
(); publicDate
(long date); public longgetTime
(); public voidsetTime
(long time); public booleanequals
(Object obj); public inthashCode
(); }
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.