Class java.sql.Date
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.sql.Date

java.lang.Object
   |
   +----java.util.Date
           |
           +----java.sql.Date

public class Date
extends Date

This class is used to represent a subset of the standard java.util.date information. We only deal with days and ignore hours, minutes, and seconds. This lets us represent SQL DATE information.


Constructor Index

 o Date(int, int, int)
Construct a Date

Method Index

 o toString()
Format a date as yyyy-mm-dd
 o valueOf(String)
Convert a formatted string to a Date value

Constructors

 o Date
  public Date(int year,
              int month,
              int day)
Construct a Date
Parameters:
year - year-1900
month - 0 to 11
day - 1 to 31

Methods

 o valueOf
  public static Date valueOf(String s)
Convert a formatted string to a Date value
Parameters:
s - date in format "yyyy-mm-dd"
Returns:
corresponding Date
 o toString
  public String toString()
Format a date as yyyy-mm-dd
Returns:
a formatted date String
Overrides:
toString in class Date

All Packages  Class Hierarchy  This Package  Previous  Next  Index