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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | serialVersionUID
Private serial version unique ID to ensure serialization
compatibility.
|
| Access | Constructor and Description |
|---|---|
| public | Time(int
0 to 23 hour, int 0 to 59 minute, int 0 to 59 second)
Deprecated
since 1.2. Use the constructor that takes a milliseconds value
in place of this constructor
Constructs a |
| public | Time(long
milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMT time)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public int | getDate()
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public int | getDay()
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public int | getMonth()
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public int | getYear()
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public void | setDate(int i)
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public void | setMonth(int i)
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public void | setTime(long
milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMT time)Overrides java. Sets a |
| public void | setYear(int i)
Overrides java.
Deprecated
since 1.2.
This method is deprecated and should not be used because SQL |
| public Instant | toInstant()
Overrides java. This method always throws an UnsupportedOperationException and should
not be used because SQL |
| public LocalTime | Returns: aLocalTime object representing the same time valueConverts this |
| public String | Returns: aString in hh:mm:ss formatOverrides java. Formats a time in JDBC time escape format. |
| public static Time | |
| public static Time |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides java. Private serial version unique ID to ensure serialization compatibility. | |
| Time | back to summary |
|---|---|
| public Time(int hour, int minute, int second)
Deprecated since 1.2. Use the constructor that takes a milliseconds value in place of this constructor Constructs a The result is undefined if a given argument is out of bounds.
| |
| Time | back to summary |
|---|---|
| public Time(long time) Constructs a
| |
| getDate | back to summary |
|---|---|
| public int getDate() Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| getDay | back to summary |
|---|---|
| public int getDay() Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| getMonth | back to summary |
|---|---|
| public int getMonth() Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| getYear | back to summary |
|---|---|
| public int getYear() Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| setDate | back to summary |
|---|---|
| public void setDate(int i) Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| setMonth | back to summary |
|---|---|
| public void setMonth(int i) Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| setTime | back to summary |
|---|---|
| public void setTime(long time) Overrides java. Sets a
| |
| setYear | back to summary |
|---|---|
| public void setYear(int i) Overrides java. Deprecated since 1.2.
This method is deprecated and should not be used because SQL
| |
| toInstant | back to summary |
|---|---|
| public Instant toInstant() Overrides java. This method always throws an UnsupportedOperationException and should
not be used because SQL
| |
| toLocalTime | back to summary |
|---|---|
| public LocalTime toLocalTime() Converts this
The conversion creates a
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Formats a time in JDBC time escape format.
| |
| valueOf | back to summary |
|---|---|
| public static Time valueOf(String s) Converts a string in JDBC time escape format to a | |
| valueOf | back to summary |
|---|---|
| public static Time valueOf(LocalTime time) Obtains an instance of
| |