Class JdbcTime

  • JdbcTime represents a JDBCTime object.

  • It provides methods for comparing time objects (after,before) and getting/setting hours, minutes, seconds, and the time in milliseconds.

  • Most methods of JdbcTime correspond to methods in thejava.sql.Date orjava.sql.Time classes in Java.

JdbcTime

A JDBCTime. For documentation of this class, seejava.sql.Time.

Methods

MethodReturn typeBrief description
after(when)BooleanFor documentation of this method, seejava.sql.Date#after(Date).
before(when)BooleanFor documentation of this method, seejava.sql.Date#before(Date).
getHours()IntegerFor documentation of this method, seejava.sql.Date#getHours().
getMinutes()IntegerFor documentation of this method, seejava.sql.Date#getMinutes().
getSeconds()IntegerFor documentation of this method, seejava.sql.Date#getSeconds().
getTime()IntegerFor documentation of this method, seejava.sql.Date#getTime().
setHours(hours)voidFor documentation of this method, seejava.sql.Date#setHours(int).
setMinutes(minutes)voidFor documentation of this method, seejava.sql.Date#setMinutes(int).
setSeconds(seconds)voidFor documentation of this method, seejava.sql.Date#setSeconds(int).
setTime(milliseconds)voidFor documentation of this method, seejava.sql.Time#setTime(long).

Detailed documentation

after(when)

For documentation of this method, seejava.sql.Date#after(Date).

Parameters

NameTypeDescription
whenJdbcTimeA time to compare to.

Return

Booleantrue if and only if this time is strictly later than the time specified as a parameter;false otherwise.


before(when)

For documentation of this method, seejava.sql.Date#before(Date).

Parameters

NameTypeDescription
whenJdbcTimeA time to compare to.

Return

Booleantrue if and only if this time is strictly earlier than the time specified as a parameter;false otherwise.


getHours()

For documentation of this method, seejava.sql.Date#getHours().

Return

Integer — The hour represented by this object; the value is a number (0 through 23) representing the hour within the day that contains or begins with the instant in time represented by this object, as interpreted in the local time zone.


getMinutes()

For documentation of this method, seejava.sql.Date#getMinutes().

Return

Integer — The minutes past the hour represented by this object, as interpreted in the local time zone. The value is a number between 0 through 59 inclusive.


getSeconds()

For documentation of this method, seejava.sql.Date#getSeconds().

Return

Integer — The seconds past the minute represented by this object, as interpreted in the local time zone. The value is a number between 0 through 61 inclusive, whiere 60 and 61 are only possible for machines that take leap seconds into account.


getTime()

For documentation of this method, seejava.sql.Date#getTime().

Return

Integer — The number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this time object.


setHours(hours)

For documentation of this method, seejava.sql.Date#setHours(int).

Parameters

NameTypeDescription
hoursIntegerThe 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.

setMinutes(minutes)

For documentation of this method, seejava.sql.Date#setMinutes(int).

Parameters

NameTypeDescription
minutesIntegerThe 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.

setSeconds(seconds)

For documentation of this method, seejava.sql.Date#setSeconds(int).

Parameters

NameTypeDescription
secondsIntegerThe 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.

setTime(milliseconds)

For documentation of this method, seejava.sql.Time#setTime(long).

Parameters

NameTypeDescription
millisecondsIntegerThe 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.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.