| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class Time extends Date
A thin wrapper around the java.util.Date
class that allows the JDBC
API to identify this as an SQL TIME
value. The Time
class adds formatting and
parsing operations to support the JDBC escape syntax for time
values.
The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed.
Constructor Summary | |
---|---|
Time(int hour, int minute, int second) Constructs a Time object initialized with the
given values for the hour, minute, and second.
|
|
Time(long time) Constructs a Time object using a milliseconds time value.
|
Method Summary | |
---|---|
int |
getDate() This method is deprecated and should not be used because SQL TIME
values do not have a date component.
|
int |
getDay() This method is deprecated and should not be used because SQL TIME
values do not have a day component.
|
int |
getMonth() This method is deprecated and should not be used because SQL TIME
values do not have a month component.
|
int |
getYear() This method is deprecated and should not be used because SQL TIME
values do not have a year component.
|
void |
setDate(int i) This method is deprecated and should not be used because SQL TIME
values do not have a date component.
|
void |
setMonth(int i) This method is deprecated and should not be used because SQL TIME
values do not have a month component.
|
void |
setTime(long time) Sets a Time object using a milliseconds time value.
|
void |
setYear(int i) This method is deprecated and should not be used because SQL TIME
values do not have a year component.
|
String |
toString() Formats a time in JDBC time escape format. |
static Time |
Converts a string in JDBC time escape format to a Time value.
|
Methods inherited from class java.util.Date |
---|
after, before, clone, compareTo, diff, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, toString, UTC |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Time(int hour, int minute, int second)
Time
object initialized with the
given values for the hour, minute, and second.
The driver sets the date components to January 1, 1970.
Any method that attempts to access the date components of a
Time
object will throw a
java.lang.IllegalArgumentException
.
The result is undefined if a given argument is out of bounds.
hour
- 0 to 23minute
- 0 to 59second
- 0 to 59public Time(long time)
Time
object using a milliseconds time value.
time
- milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMTMethod Detail |
---|
public int getDate()
TIME
values do not have a date component.
getDate
in class Date
public int getDay()
TIME
values do not have a day component.
getDay
in class Date
public int getMonth()
TIME
values do not have a month component.
getMonth
in class Date
public int getYear()
TIME
values do not have a year component.
getYear
in class Date
public void setDate(int i)
TIME
values do not have a date component.
setDate
in class Date
i
public void setMonth(int i)
TIME
values do not have a month component.
setMonth
in class Date
i
public void setTime(long time)
Time
object using a milliseconds time value.
setTime
in class Date
time
- milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMTpublic void setYear(int i)
TIME
values do not have a year component.
setYear
in class Date
i
public String toString()
toString
in class Date
String
in hh:mm:ss formatpublic static Time valueOf(String s)
Time
value.
s
- time in format "hh:mm:ss"Time
object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |