GeezerVison is showing docs.oracle.com — Time (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact2, compact3
java.sql
Class Time
-
-
Constructor Summary
Constructors
| Constructor |
Description |
Time(int hour,
int minute,
int second) |
Deprecated.
Use the constructor that takes a milliseconds value
in place of this constructor
|
Time(long time) |
Constructs a Time object using a milliseconds time value.
|
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
int |
getDate() |
Deprecated.
|
int |
getDay() |
Deprecated.
|
int |
getMonth() |
Deprecated.
|
int |
getYear() |
Deprecated.
|
void |
setDate(int i) |
Deprecated.
|
void |
setMonth(int i) |
Deprecated.
|
void |
setTime(long time) |
Sets a Time object using a milliseconds time value.
|
void |
setYear(int i) |
Deprecated.
|
Instant |
toInstant() |
This method always throws an UnsupportedOperationException and should
not be used because SQL Time values do not have a date
component.
|
LocalTime |
toLocalTime() |
Converts this Time object to a LocalTime.
|
String |
toString() |
Formats a time in JDBC time escape format.
|
static Time |
valueOf(LocalTime time) |
Obtains an instance of Time from a LocalTime object
with the same hour, minute and second time value as the given
LocalTime.
|
static Time |
valueOf(String s) |
Converts a string in JDBC time escape format to a Time value.
|
-
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, from, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC
-
-
Constructor Detail
-
Time
@Deprecated
public Time(int hour,
int minute,
int second)
Deprecated. Use the constructor that takes a milliseconds value
in place of this constructor
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
minute - 0 to 59
second - 0 to 59
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|