Class JdbcTime
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
JdbcTime
Un Time
JDBC. Per la documentazione di questa classe, consulta java.sql.Time
.
Metodi
Metodo | Tipo restituito | Breve descrizione |
after(when) | Boolean | Per la documentazione di questo metodo, consulta
java.sql.Date#after(Date) . |
before(when) | Boolean | Per la documentazione di questo metodo, consulta
java.sql.Date#before(Date) . |
getHours() | Integer | Per la documentazione di questo metodo, consulta
java.sql.Date#getHours() . |
getMinutes() | Integer | Per la documentazione di questo metodo, consulta
java.sql.Date#getMinutes() . |
getSeconds() | Integer | Per la documentazione di questo metodo, consulta
java.sql.Date#getSeconds() . |
getTime() | Integer | Per la documentazione di questo metodo, consulta
java.sql.Date#getTime() . |
setHours(hours) | void | Per la documentazione di questo metodo, consulta
java.sql.Date#setHours(int) . |
setMinutes(minutes) | void | Per la documentazione di questo metodo, consulta
java.sql.Date#setMinutes(int) . |
setSeconds(seconds) | void | Per la documentazione di questo metodo, consulta
java.sql.Date#setSeconds(int) . |
setTime(milliseconds) | void | Per la documentazione di questo metodo, consulta
java.sql.Time#setTime(long) . |
Documentazione dettagliata
after(when)
Per la documentazione di questo metodo, consulta
java.sql.Date#after(Date)
.
Parametri
Nome | Tipo | Descrizione |
when | JdbcTime | Un periodo di tempo di riferimento. |
Invio
Boolean
- true
se e solo se questa ora è strettamente successiva a quella specificata come parametro; false
in caso contrario.
before(when)
Per la documentazione di questo metodo, consulta
java.sql.Date#before(Date)
.
Parametri
Nome | Tipo | Descrizione |
when | JdbcTime | Un periodo di tempo di riferimento. |
Invio
Boolean
- true
se e solo se questa ora è strettamente precedente all'ora specificata come parametro; false
in caso contrario.
getHours()
Per la documentazione di questo metodo, consulta
java.sql.Date#getHours()
.
Invio
Integer
: l'ora rappresentata da questo oggetto. Il valore è un numero (da 0 a 23) che rappresenta
l'ora del giorno che contiene o inizia con l'istante nel tempo rappresentato da
questo oggetto, come interpretato nel fuso orario locale.
getMinutes()
Per la documentazione di questo metodo, consulta
java.sql.Date#getMinutes()
.
Invio
Integer
: i minuti dopo l'ora rappresentati da questo oggetto, interpretati nel fuso orario locale. Il valore è un numero compreso tra 0 e 59 inclusi.
getSeconds()
Per la documentazione di questo metodo, consulta
java.sql.Date#getSeconds()
.
Invio
Integer
: i secondi dopo il minuto rappresentato da questo oggetto, come interpretato nel fuso orario locale. Il valore è un numero compreso tra 0 e 61 inclusi, dove 60 e 61 sono possibili solo per le macchine che tengono conto dei secondi intercalari.
getTime()
Per la documentazione di questo metodo, consulta
java.sql.Date#getTime()
.
Invio
Integer
: il numero di millisecondi dal 1° gennaio 1970 00:00:00 GMT rappresentato da questo oggetto
time.
setHours(hours)
Per la documentazione di questo metodo, consulta
java.sql.Date#setHours(int)
.
Parametri
Nome | Tipo | Descrizione |
hours | Integer | L'ora da impostare. Questo oggetto viene aggiornato per rappresentare un punto nel tempo all'interno
dell'ora specificata del giorno, con anno, mese, data, minuto e secondo uguali
a quelli precedenti, come interpretato nel fuso orario locale. |
setMinutes(minutes)
Per la documentazione di questo metodo, consulta
java.sql.Date#setMinutes(int)
.
Parametri
Nome | Tipo | Descrizione |
minutes | Integer | I minuti da impostare. Questo oggetto viene aggiornato per rappresentare un punto nel tempo all'interno del minuto specificato dell'ora, con anno, mese, data, ora e secondo uguali a quelli precedenti, come interpretato nel fuso orario locale. |
setSeconds(seconds)
Per la documentazione di questo metodo, consulta
java.sql.Date#setSeconds(int)
.
Parametri
Nome | Tipo | Descrizione |
seconds | Integer | I secondi da impostare. Questo oggetto viene aggiornato per rappresentare un punto nel tempo all'interno
del secondo specificato del minuto, con anno, mese, data, ora e minuto uguali
a quelli precedenti, come interpretato nel fuso orario locale. |
setTime(milliseconds)
Per la documentazione di questo metodo, consulta
java.sql.Time#setTime(long)
.
Parametri
Nome | Tipo | Descrizione |
milliseconds | Integer | Il valore dell'ora da impostare. Il valore è espresso in millisecondi dal 1° gennaio 1970,
00:00:00 GMT, mentre un numero negativo indica i millisecondi precedenti a questa data e ora. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]