Class JdbcTime
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
JdbcTime
Um Time
JDBC. Para consultar a documentação dessa classe, consulte java.sql.Time
.
Métodos
Método | Tipo de retorno | Breve descrição |
after(when) | Boolean | Para consultar a documentação desse método, acesse
java.sql.Date#after(Date) . |
before(when) | Boolean | Para consultar a documentação desse método, acesse
java.sql.Date#before(Date) . |
getHours() | Integer | Para consultar a documentação desse método, acesse
java.sql.Date#getHours() . |
getMinutes() | Integer | Para consultar a documentação desse método, acesse
java.sql.Date#getMinutes() . |
getSeconds() | Integer | Para consultar a documentação desse método, acesse
java.sql.Date#getSeconds() . |
getTime() | Integer | Para consultar a documentação desse método, acesse
java.sql.Date#getTime() . |
setHours(hours) | void | Para consultar a documentação desse método, acesse
java.sql.Date#setHours(int) . |
setMinutes(minutes) | void | Para consultar a documentação desse método, acesse
java.sql.Date#setMinutes(int) . |
setSeconds(seconds) | void | Para consultar a documentação desse método, acesse
java.sql.Date#setSeconds(int) . |
setTime(milliseconds) | void | Para consultar a documentação desse método, acesse
java.sql.Time#setTime(long) . |
Documentação detalhada
after(when)
Para consultar a documentação desse método, acesse
java.sql.Date#after(Date)
.
Parâmetros
Nome | Tipo | Descrição |
when | JdbcTime | Um horário para comparar. |
Retornar
Boolean
: true
se e somente se esse horário for estritamente posterior ao horário especificado como
parâmetro; false
, caso contrário.
before(when)
Para consultar a documentação desse método, acesse
java.sql.Date#before(Date)
.
Parâmetros
Nome | Tipo | Descrição |
when | JdbcTime | Um horário para comparar. |
Retornar
Boolean
: true
se e somente se esse horário for estritamente anterior ao horário especificado como
parâmetro. Caso contrário, será false
.
getHours()
Para consultar a documentação desse método, acesse
java.sql.Date#getHours()
.
Retornar
Integer
: a hora representada por esse objeto. O valor é um número (0 a 23) que representa
a hora do dia que contém ou começa com o instante representado por
esse objeto, conforme interpretado no fuso horário local.
getMinutes()
Para consultar a documentação desse método, acesse
java.sql.Date#getMinutes()
.
Retornar
Integer
: os minutos após a hora representada por este objeto, conforme interpretado no fuso horário
local. O valor é um número entre 0 e 59.
getSeconds()
Para consultar a documentação desse método, acesse
java.sql.Date#getSeconds()
.
Retornar
Integer
: os segundos após o minuto representado por este objeto, conforme interpretado no fuso horário
local. O valor é um número entre 0 e 61, sendo que 60 e 61 são possíveis
apenas para máquinas que consideram os segundos bissextos.
getTime()
Para consultar a documentação desse método, acesse
java.sql.Date#getTime()
.
Retornar
Integer
: o número de milissegundos desde 1º de janeiro de 1970, 00:00:00 GMT, representado por esse objeto de
tempo.
setHours(hours)
Para consultar a documentação desse método, acesse
java.sql.Date#setHours(int)
.
Parâmetros
Nome | Tipo | Descrição |
hours | Integer | A hora a ser definida. Esse objeto é atualizado para representar um ponto no tempo dentro da
hora especificada do dia, com o ano, mês, data, minuto e segundo iguais aos
anteriores, conforme interpretado no fuso horário local. |
setMinutes(minutes)
Para consultar a documentação desse método, acesse
java.sql.Date#setMinutes(int)
.
Parâmetros
Nome | Tipo | Descrição |
minutes | Integer | Os minutos a serem definidos. Esse objeto é atualizado para representar um ponto no tempo dentro
do minuto especificado da hora, com o ano, o mês, a data, a hora e o segundo iguais aos
anteriores, conforme interpretado no fuso horário local. |
setSeconds(seconds)
Para consultar a documentação desse método, acesse
java.sql.Date#setSeconds(int)
.
Parâmetros
Nome | Tipo | Descrição |
seconds | Integer | Os segundos a serem definidos. Esse objeto é atualizado para representar um ponto no tempo dentro
do segundo especificado do minuto, com o ano, o mês, a data, a hora e o minuto iguais
aos anteriores, conforme interpretado no fuso horário local. |
setTime(milliseconds)
Para consultar a documentação desse método, acesse
java.sql.Time#setTime(long)
.
Parâmetros
Nome | Tipo | Descrição |
milliseconds | Integer | O valor de tempo a ser definido. O valor é de milissegundos desde 1º de janeiro de 1970,
00:00:00 GMT, enquanto um número negativo é de milissegundos antes desse horário. |
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eJdbcTime\u003c/code\u003e provides a JDBC representation of time, mirroring the functionality of \u003ccode\u003ejava.sql.Time\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to compare times (\u003ccode\u003eafter\u003c/code\u003e, \u003ccode\u003ebefore\u003c/code\u003e), retrieve time components (\u003ccode\u003egetHours\u003c/code\u003e, \u003ccode\u003egetMinutes\u003c/code\u003e, \u003ccode\u003egetSeconds\u003c/code\u003e), and get the time in milliseconds (\u003ccode\u003egetTime\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eYou can modify the time using \u003ccode\u003esetHours\u003c/code\u003e, \u003ccode\u003esetMinutes\u003c/code\u003e, \u003ccode\u003esetSeconds\u003c/code\u003e, and \u003ccode\u003esetTime\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDetailed documentation for each method is provided with links to the corresponding \u003ccode\u003ejava.sql.Time\u003c/code\u003e or \u003ccode\u003ejava.util.Date\u003c/code\u003e documentation.\u003c/p\u003e\n"]]],[],null,["# Class JdbcTime\n\nJdbcTime\n\nA JDBC `Time`. For documentation of this class, see [`java.sql.Time`](https://docs.oracle.com/javase/6/docs/api/java/sql/Time.html). \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [after(when)](#after(JdbcTime)) | `Boolean` | For documentation of this method, see [`java.sql.Date#after(Date)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#after(java.util.Date)). |\n| [before(when)](#before(JdbcTime)) | `Boolean` | For documentation of this method, see [`java.sql.Date#before(Date)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#before(java.util.Date)). |\n| [getHours()](#getHours()) | `Integer` | For documentation of this method, see [` java.sql.Date#getHours()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getHours()). |\n| [getMinutes()](#getMinutes()) | `Integer` | For documentation of this method, see [` java.sql.Date#getMinutes()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getMinutes()). |\n| [getSeconds()](#getSeconds()) | `Integer` | For documentation of this method, see [` java.sql.Date#getSeconds()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getSeconds()). |\n| [getTime()](#getTime()) | `Integer` | For documentation of this method, see [` java.sql.Date#getTime()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getTime()). |\n| [setHours(hours)](#setHours(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setHours(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setHours(int)). |\n| [setMinutes(minutes)](#setMinutes(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setMinutes(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setMinutes(int)). |\n| [setSeconds(seconds)](#setSeconds(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setSeconds(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setSeconds(int)). |\n| [setTime(milliseconds)](#setTime(Integer)) | `void` | For documentation of this method, see [` java.sql.Time#setTime(long)`](https://docs.oracle.com/javase/6/docs/api/java/sql/Time.html#setTime(long)). |\n\nDetailed documentation\n----------------------\n\n### `after(when)`\n\nFor documentation of this method, see [`java.sql.Date#after(Date)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#after(java.util.Date)).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|---------------|-----------------------|\n| `when` | [JdbcTime](#) | A time to compare to. |\n\n#### Return\n\n\n`Boolean` --- `true` if and only if this time is strictly later than the time specified as a\nparameter; `false` otherwise.\n\n*** ** * ** ***\n\n### `before(when)`\n\nFor documentation of this method, see [`java.sql.Date#before(Date)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#before(java.util.Date)).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|---------------|-----------------------|\n| `when` | [JdbcTime](#) | A time to compare to. |\n\n#### Return\n\n\n`Boolean` --- `true` if and only if this time is strictly earlier than the time specified as a\nparameter; `false` otherwise.\n\n*** ** * ** ***\n\n### `get``Hours()`\n\nFor documentation of this method, see [`\njava.sql.Date#getHours()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getHours()).\n\n#### Return\n\n\n`Integer` --- The hour represented by this object; the value is a number (0 through 23) representing\nthe hour within the day that contains or begins with the instant in time represented by\nthis object, as interpreted in the local time zone.\n\n*** ** * ** ***\n\n### `get``Minutes()`\n\nFor documentation of this method, see [`\njava.sql.Date#getMinutes()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getMinutes()).\n\n#### Return\n\n\n`Integer` --- The minutes past the hour represented by this object, as interpreted in the local time\nzone. The value is a number between 0 through 59 inclusive.\n\n*** ** * ** ***\n\n### `get``Seconds()`\n\nFor documentation of this method, see [`\njava.sql.Date#getSeconds()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getSeconds()).\n\n#### Return\n\n\n`Integer` --- The seconds past the minute represented by this object, as interpreted in the local\ntime zone. The value is a number between 0 through 61 inclusive, whiere 60 and 61 are only\npossible for machines that take leap seconds into account.\n\n*** ** * ** ***\n\n### `get``Time()`\n\nFor documentation of this method, see [`\njava.sql.Date#getTime()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getTime()).\n\n#### Return\n\n\n`Integer` --- The number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this time\nobject.\n\n*** ** * ** ***\n\n### `set``Hours(hours)`\n\nFor documentation of this method, see [`\njava.sql.Date#setHours(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setHours(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `hours` | `Integer` | The hour to set; this object is updated to represent a point in time within the specified hour of the day, with the year, month, date, minute, and second the same as before, as interpreted in the local time zone. |\n\n*** ** * ** ***\n\n### `set``Minutes(minutes)`\n\nFor documentation of this method, see [`\njava.sql.Date#setMinutes(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setMinutes(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `minutes` | `Integer` | The minutes to set; this object is updated to represent a point in time within the specified minute of the hour, with the year, month, date, hour, and second the same as before, as interpreted in the local time zone. |\n\n*** ** * ** ***\n\n### `set``Seconds(seconds)`\n\nFor documentation of this method, see [`\njava.sql.Date#setSeconds(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setSeconds(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `seconds` | `Integer` | The seconds to set; this object is updated to represent a point in time within the specified second of the minute, with the year, month, date, hour, and minute the same as before, as interpreted in the local time zone. |\n\n*** ** * ** ***\n\n### `set``Time(milliseconds)`\n\nFor documentation of this method, see [`\njava.sql.Time#setTime(long)`](https://docs.oracle.com/javase/6/docs/api/java/sql/Time.html#setTime(long)).\n\n#### Parameters\n\n| Name | Type | Description |\n|----------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| `milliseconds` | `Integer` | The time value to set. The value is milliseconds since January 1, 1970, 00:00:00 GMT, while a negative number is milliseconds before that time. |"]]