public class Date extends Object implements Comparable<Date>
Constructor and Description |
---|
Date()
Allocates a Date object and initializes it to represent the current time specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
|
Date(long date)
Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Date arg0)
Compares this object to the specified object to determine their relative
order.
|
boolean |
equals(Object obj)
Compares two dates for equality.
|
long |
getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
|
int |
hashCode()
Returns a hash code value for this object.
|
void |
setTime(long time)
Sets this Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
|
String |
toString()
Converts this Date object to a String of the form: dow mon dd hh:mm:ss zzz yyyy where: dow is the day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat).
|
public Date()
public Date(long date)
public boolean equals(Object obj)
public long getTime()
public int hashCode()
public void setTime(long time)
public String toString()
public int compareTo(Date arg0)
Comparable
compareTo
in interface Comparable<Date>
arg0
- the object to compare to this instance.another
;
a positive integer if this instance is greater than
another
; 0 if this instance has the same order as
another
.