API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.sql. Date View Source
Author(s)
Since
Version
Serial
Hierarchy
 Object
      Date
          Date
Implements
Subclasses
Description
public class Date
  A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value.
See also:   
Constructors
public Date (int year, int month, int day)
  Constructs a Date object initialized with the given year, month, and day.
public Date (long date)
  Constructs a Date object using the given milliseconds time value.
Methods
Hide/Show inherited methods
public boolean after (Date when) [Inherited From Date]
  Tests if this date is after the specified date.
public boolean before (Date when) [Inherited From Date]
  Tests if this date is before the specified date.
public Object clone () [Inherited From Date]
Return a copy of this object.
public int compareTo (Date anotherDate) [Inherited From Date]
  Compares two Dates for ordering.
public boolean equals (Object obj) [Inherited From Date]
  Compares two dates for equality.
@Deprecated
public int getDate () [Inherited From Date]
  Returns the day of the month represented by this Date object.
@Deprecated
public int getDay () [Inherited From Date]
  Returns the day of the week represented by this date.
public int getHours () [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
public int getMinutes () [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
@Deprecated
public int getMonth () [Inherited From Date]
  Returns a number representing the month that contains or begins with the instant in time represented by this Date object.
public int getSeconds () [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
public long getTime () [Inherited From Date]
  Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
@Deprecated
public int getTimezoneOffset () [Inherited From Date]
  Returns the offset, measured in minutes, for the local time zone relative to UTC that is appropriate for the time represented by this Date object.
@Deprecated
public int getYear () [Inherited From Date]
  Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone.
public int hashCode () [Inherited From Date]
  Returns a hash code value for this object.
@Deprecated
publicstatic long parse (String s) [Inherited From Date]
  Attempts to interpret the string s as a representation of a date and time.
@Deprecated
public void setDate (int date) [Inherited From Date]
  Sets the day of the month of this Date object to the specified value.
public void setHours (int i) [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
public void setMinutes (int i) [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
@Deprecated
public void setMonth (int month) [Inherited From Date]
  Sets the month of this date to the specified value.
public void setSeconds (int i) [Overrides Date]
  This method is deprecated and should not be used because SQL Date values do not have a time component.
public void setTime (long date) [Overrides Date]
  Sets an existing Date object using the given milliseconds time value.
@Deprecated
public void setYear (int year) [Inherited From Date]
  Sets the year of this Date object to be the specified value plus 1900.
@Deprecated
public String toGMTString () [Inherited From Date]
  Creates a string representation of this Date object of the form:
where:
  • d is the day of the month (1 through 31), as one or two decimal digits.
  • mon is the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
  • yyyy is the year, as four decimal digits.
  • hh is the hour of the day (00 through 23), as two decimal digits.
  • mm is the minute within the hour (00 through 59), as two decimal digits.
  • ss is the second within the minute (00 through 61), as two decimal digits.
  • GMT is exactly the ASCII letters "GMT" to indicate Greenwich Mean Time.

The result does not depend on the local time zone.
Returns: a string representation of this date, using the Internet GMT conventions.
See Also: DateFormat, Date.toString(), Date.toLocaleString(),

@Deprecated
public String toLocaleString () [Inherited From Date]
  Creates a string representation of this Date object in an implementation-dependent form.
public String toString () [Overrides Date]
  Formats a date in the date escape format yyyy-mm-dd.
@Deprecated
publicstatic long UTC (int year, int month, int date, int hrs, int min, int sec) [Inherited From Date]
  Determines the date and time based on the arguments.
publicstatic Date valueOf (String s)
  Converts a string in JDBC date escape format to a Date value.
Fields
Hide/Show inherited fields
pack-privatefinalstatic long serialVersionUID = "1511598038487230103"
Private serial version unique ID to ensure serialization compatibility.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar