Date (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>
-
Constructor Summary
Constructors
-
Method Summary
intgetHours()intintvoidsetHours(int i) voidsetMinutes(int i) voidsetSeconds(int i) voidsetTime(long date) Sets an existing
Dateobject using the given milliseconds time value.This method always throws an UnsupportedOperationException and should not be used because SQL
Datevalues do not have a time component.Creates a
LocalDateinstance using the year, month and day from thisDateobject.toString()Formats a date in the date escape format yyyy-mm-dd.
Converts a string in JDBC date escape format to a
Datevalue.Obtains an instance of
Datefrom aLocalDateobject with the same year, month and day of month value as the givenLocalDate.Methods declared in class Date
after, before, clone, compareTo, equals, from, getDate, getDay, getMonth, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setMonth, setYear, toGMTString, toLocaleString, UTCbooleanTests if this date is after the specified date.
booleanTests if this date is before the specified date.
Return a copy of this object.
intCompares two Dates for ordering.
booleanCompares two dates for equality.
Obtains an instance of
Datefrom anInstantobject.intintintlongReturns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this
Dateobject.intintintReturns a hash code value for this object.
static longvoidvoidvoidstatic longUTC(int year, int month, int date, int hrs, int min, int sec) Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitprotected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
Date
-
Date
-
-
Method Details
-
setTime
-
valueOf
-
toString
-
getHours
-
getMinutes
-
getSeconds
-
setHours
-
setMinutes
-
setSeconds
-
valueOf
-
toLocalDate
-
toInstant
-