public class Date extends Date
The Date class extends the standard java.util.date class to represent SQL DATE types. It supports the JDBC escape syntax for date values.
Date
public Date(int year, int month, int day)
This creates a Date object.
Parameters:
year: | The year minus 1900 |
month: | 0 to 11 |
day: | 1 to 31 |
Date
public Date(long date)
This creates a Date object using a time value in milliseconds.
Parameters:
date: | The milliseconds since January 1, 1970, 00:00:00 GMT |
toString
public String toString()
This converts a date to YYYY-MM-DD format.
Returns: A formatted date String
valueOf
public static Date valueOf(String s)
This converts a YYYY-MM-DD formatted string to a Date value.
Parameters:
s: | The date in format YYYY-MM-DD |
Returns: A Date