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.
-
Date(int, int, int)
- Construct a Date
-
toString()
- Format a date as yyyy-mm-dd
-
valueOf(String)
- Convert a formatted string to a Date value
Date
public Date(int year,
int month,
int day)
- Construct a Date
- Parameters:
- year - year-1900
- month - 0 to 11
- day - 1 to 31
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
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