java.sql
public class Time extends Date
Constructor and Description |
---|
Time(int hour,
int minute,
int second)
Deprecated.
|
Time(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 |
getDate()
Deprecated.
|
int |
getDay()
Deprecated.
|
int |
getMonth()
Deprecated.
|
int |
getYear()
Deprecated.
|
void |
setDate(int newValue)
Deprecated.
|
void |
setMonth(int newValue)
Deprecated.
|
void |
setYear(int newValue)
Deprecated.
|
String |
toString()
This method returns this date in JDBC format.
|
static Time |
valueOf(String str)
This method returns a new instance of this class by parsing a
date in JDBC format into a Java date.
|
after, before, clone, compareTo, equals, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, setTime, toGMTString, toLocaleString, UTC
public Time(int hour, int minute, int second)
hour
- The hour for this Time (0-23)minute
- The minute for this time (0-59)second
- The second for this time (0-59)public Time(long date)
date
- The time value to intialize this Time
to.public int getDate() throws IllegalArgumentException
getDate
in class Date
IllegalArgumentException
- when it's called.Calendar
,
Date.setDate(int)
public int getDay() throws IllegalArgumentException
getDay
in class Date
IllegalArgumentException
- when it's called.Calendar
public int getMonth() throws IllegalArgumentException
getMonth
in class Date
IllegalArgumentException
- when it's called.Date.setMonth(int)
,
Calendar
public int getYear() throws IllegalArgumentException
getYear
in class Date
IllegalArgumentException
- when it's called.Calendar
,
Date.setYear(int)
public void setDate(int newValue) throws IllegalArgumentException
setDate
in class Date
newValue
- the date.IllegalArgumentException
- when it's called.Calendar
,
Date.getDate()
public void setMonth(int newValue) throws IllegalArgumentException
setMonth
in class Date
newValue
- the month, with a zero-based index
from January.IllegalArgumentException
- when it's called.Date.getMonth()
,
Calendar
public void setYear(int newValue) throws IllegalArgumentException
setYear
in class Date
newValue
- the year minus 1900.IllegalArgumentException
- when it's called.Date.getYear()
,
Calendar
public static Time valueOf(String str)
str
- The string to parse.java.sql.Time
value.public String toString()
toString
in class Date
Date.parse(String)
,
DateFormat