public class Date extends Date
Constructor and Description |
---|
Date(int year,
int month,
int day)
Deprecated.
|
Date(long date)
This method initializes a new instance of this class with the
specified time value representing the number of milliseconds since
Jan 1, 1970 at 12:00 midnight GMT.
|
Modifier and Type | Method and Description |
---|---|
int |
getHours()
Deprecated.
|
int |
getMinutes()
Deprecated.
|
int |
getSeconds()
Deprecated.
|
void |
setHours(int newValue)
Deprecated.
|
void |
setMinutes(int newValue)
Deprecated.
|
void |
setSeconds(int newValue)
Deprecated.
|
String |
toString()
This method returns this date in JDBC format.
|
static Date |
valueOf(String str)
This method returns a new instance of this class by parsing a
date in JDBC format into a Java date.
|
public Date(int year, int month, int day)
year
- The year of this date minue 1900.month
- The month of this date (0-11).day
- The day of this date (1-31).public Date(long date)
date
- The time value to intialize this date to.public int getHours() throws IllegalArgumentException
getHours
in class Date
IllegalArgumentException
- when it's called.Calendar
,
Date.setHours(int)
public int getMinutes() throws IllegalArgumentException
getMinutes
in class Date
IllegalArgumentException
- when it's called.Calendar
,
Date.setMinutes(int)
public int getSeconds() throws IllegalArgumentException
getSeconds
in class Date
IllegalArgumentException
- when it's called.Calendar
,
Date.setSeconds(int)
public void setHours(int newValue) throws IllegalArgumentException
setHours
in class Date
newValue
- the hours.IllegalArgumentException
- when it's called.Calendar
,
Date.getHours()
public void setMinutes(int newValue) throws IllegalArgumentException
setMinutes
in class Date
newValue
- the minutes.IllegalArgumentException
- when it's called.Calendar
,
Date.getMinutes()
public void setSeconds(int newValue) throws IllegalArgumentException
setSeconds
in class Date
newValue
- the seconds.IllegalArgumentException
- when it's called.Calendar
,
Date.getSeconds()
public static Date valueOf(String str)
str
- The string to parse.java.sql.Date
value.public String toString()
toString
in class Date
Date.parse(String)
,
DateFormat