Modifier and Type |
Method |
Description |
boolean |
after(Date when) |
Tests if this date is after the specified date.
|
boolean |
before(Date when) |
Tests if this date is before the specified date.
|
Object |
clone() |
Return a copy of this object.
|
int |
compareTo(Date anotherDate) |
Compares two Dates for ordering.
|
boolean |
equals(Object obj) |
Compares two dates for equality.
|
static Date |
from(Instant instant) |
Obtains an instance of Date from an Instant object.
|
int |
getDate() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_MONTH) .
|
int |
getDay() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_WEEK) .
|
int |
getHours() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.HOUR_OF_DAY) .
|
int |
getMinutes() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.MINUTE) .
|
int |
getMonth() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.MONTH) .
|
int |
getSeconds() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.SECOND) .
|
long |
getTime() |
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
|
int |
getTimezoneOffset() |
Deprecated.
As of JDK version 1.1, replaced by -(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000) .
|
int |
getYear() |
Deprecated.
As of JDK version 1.1, replaced by Calendar.get(Calendar.YEAR) - 1900 .
|
int |
hashCode() |
Returns a hash code value for this object.
|
static long |
parse(String s) |
Deprecated.
As of JDK version 1.1, replaced by DateFormat.parse(String s) .
|
void |
setDate(int date) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date) .
|
void |
setHours(int hours) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.HOUR_OF_DAY, int hours) .
|
void |
setMinutes(int minutes) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.MINUTE, int minutes) .
|
void |
setMonth(int month) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month) .
|
void |
setSeconds(int seconds) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.SECOND, int seconds) .
|
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.
|
void |
setYear(int year) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900) .
|
String |
toGMTString() |
Deprecated.
As of JDK version 1.1, replaced by DateFormat.format(Date date) , using a GMT TimeZone .
|
Instant |
toInstant() |
Converts this Date object to an Instant .
|
String |
toLocaleString() |
Deprecated.
As of JDK version 1.1, replaced by DateFormat.format(Date date) .
|
String |
toString() |
Converts this Date object to a String of the form:
|
static long |
UTC(int year, int month, int date, int hrs, int min, int sec) |
Deprecated.
As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec) , using a UTC TimeZone , followed by Calendar.getTime().getTime() .
|