| |
|
| java.lang.Object java.util.Date java.sql.Time
Time | public class Time extends java.util.Date (Code) | | 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.
|
Field Summary | |
final static long | serialVersionUID Private serial version unique ID to ensure serialization
compatibility. |
Constructor Summary | |
public | Time(int hour, int minute, int second) Constructs a Time object initialized with the
given values for the hour, minute, and second. | public | Time(long time) Constructs a Time object using a milliseconds time value. |
Method Summary | |
public int | getDate() This method is deprecated and should not be used because SQL TIME
values do not have a date component. | public int | getDay() This method is deprecated and should not be used because SQL TIME
values do not have a day component. | public int | getMonth() This method is deprecated and should not be used because SQL TIME
values do not have a month component. | public int | getYear() This method is deprecated and should not be used because SQL TIME
values do not have a year component. | public void | setDate(int i) This method is deprecated and should not be used because SQL TIME
values do not have a date component. | public void | setMonth(int i) This method is deprecated and should not be used because SQL TIME
values do not have a month component. | public void | setTime(long time) Sets a Time object using a milliseconds time value. | public void | setYear(int i) This method is deprecated and should not be used because SQL TIME
values do not have a year component. | public String | toString() Formats a time in JDBC time escape format. | public static Time | valueOf(String s) Converts a string in JDBC time escape format to a Time value. |
serialVersionUID | final static long serialVersionUID(Code) | | Private serial version unique ID to ensure serialization
compatibility.
|
Time | public Time(int hour, int minute, int second)(Code) | | Constructs a 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.
Parameters: hour - 0 to 23 Parameters: minute - 0 to 59 Parameters: second - 0 to 59 |
Time | public Time(long time)(Code) | | Constructs a Time object using a milliseconds time value.
Parameters: time - milliseconds since January 1, 1970, 00:00:00 GMT;a negative number is milliseconds beforeJanuary 1, 1970, 00:00:00 GMT |
getDay | public int getDay()(Code) | | This method is deprecated and should not be used because SQL TIME
values do not have a day component.
exception: java.lang.IllegalArgumentException - if thismethod is invoked |
setTime | public void setTime(long time)(Code) | | Sets a Time object using a milliseconds time value.
Parameters: time - milliseconds since January 1, 1970, 00:00:00 GMT;a negative number is milliseconds beforeJanuary 1, 1970, 00:00:00 GMT |
toString | public String toString()(Code) | | Formats a time in JDBC time escape format.
a String in hh:mm:ss format |
valueOf | public static Time valueOf(String s)(Code) | | Converts a string in JDBC time escape format to a Time value.
Parameters: s - time in format "hh:mm:ss" a corresponding Time object |
|
|
|