All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>
Direct Known Subclasses:
Date, Time, Timestamp

  • Constructor Summary

    Constructors

    Date()

    Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

    Date(int year, int month, int date)

    Date(int year, int month, int date, int hrs, int min)

    Date(int year, int month, int date, int hrs, int min, int sec)

    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.

  • Method Summary

    boolean

    Tests if this date is after the specified date.

    boolean

    Tests if this date is before the specified date.

    clone()

    Return a copy of this object.

    int

    compareTo(Date anotherDate)

    Compares two Dates for ordering.

    boolean

    Compares two dates for equality.

    Obtains an instance of Date from an Instant object.

    int

    getDate()

    int

    getDay()

    int

    getHours()

    int

    int

    getMonth()

    int

    long

    getTime()

    Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.

    int

    int

    getYear()

    int

    hashCode()

    Returns a hash code value for this object.

    static long

    void

    setDate(int date)

    void

    setHours(int hours)

    void

    setMinutes(int minutes)

    void

    setMonth(int month)

    void

    setSeconds(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)

    toInstant()

    Converts this Date object to an Instant.

    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)

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(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 void

    wait(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

    • Date

    • Date

    • Date

    • Date

  • Method Details

    • clone

    • UTC

    • parse

    • getYear

    • setYear

    • getMonth

    • setMonth

    • getDate

    • setDate

    • getDay

    • getHours

    • setHours

    • getMinutes

    • setMinutes

    • getSeconds

    • setSeconds

    • getTime

    • setTime

    • before

    • after

    • equals

    • compareTo

    • hashCode

    • toString

    • toLocaleString

    • toGMTString

    • getTimezoneOffset

    • from

    • toInstant