Class JdbcDate

  • JdbcDate represents a JDBCDate and its documentation refers tojava.sql.Date.

  • It includes methods for comparing dates such asafter() andbefore().

  • Methods likegetDate(),getMonth(),getTime(), andgetYear() allow retrieval of specific date components.

  • You can modify date components using methods likesetDate(),setMonth(),setTime(), andsetYear().

JdbcDate

A JDBCDate. For documentation of this class, seejava.sql.Date.

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).
getDate()IntegerFor documentation of this method, seejava.sql.Date#getDate().
getMonth()IntegerFor documentation of this method, seejava.sql.Date#getMonth().
getTime()IntegerFor documentation of this method, seejava.sql.Date#getTime().
getYear()IntegerFor documentation of this method, seejava.sql.Date#getYear().
setDate(date)voidFor documentation of this method, seejava.sql.Date#setDate(int).
setMonth(month)voidFor documentation of this method, seejava.sql.Date#setMonth(int).
setTime(milliseconds)voidFor documentation of this method, seejava.sql.Date#setTime(int).
setYear(year)voidFor documentation of this method, seejava.sql.Date#setYear(int).

Detailed documentation

after(when)

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

Parameters

NameTypeDescription
whenJdbcDateA date to compare to.

Return

Booleantrue if and only if this date is strictly later than the provided date;false otherwise.


before(when)

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

Parameters

NameTypeDescription
whenJdbcDateA date to compare to.

Return

Booleantrue if and only if this date is strictly earlier than the provided date;false otherwise.


getDate()

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

Return

Integer — The day of the month represented by this date. The value is between 1 and 31.


getMonth()

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

Return

Integer — The number representing the month that contains or begins with the instant in time represented by this date. The value returned is between 0 and 11, with the value 0 representing January.


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 date.


getYear()

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

Return

Integer — The result of subtracting 1900 from the year that contains or begins with the instant in time represented by this date, as interpreted in the local time zone.


setDate(date)

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

Parameters

NameTypeDescription
dateIntegerThe day of the month to set. The value is between 1 and 31, modified as needed. For example, if the date was April 30, for example, and the date is set to 31, then it is treated as if it were on May 1, because April has only 30 days.

setMonth(month)

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

Parameters

NameTypeDescription
monthIntegerThe month value to set. The value returned is between 0 and 11, with the value 0 representing January.

setTime(milliseconds)

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

Parameters

NameTypeDescription
millisecondsIntegerThe number of milliseconds since January 1, 1970, 00:00:00 GMT, not to exceed the milliseconds representation for the year 8099. A negative number indicates the number of milliseconds before January 1, 1970, 00:00:00 GMT.

setYear(year)

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

Parameters

NameTypeDescription
yearIntegerThe value to set the year with. This value plus 1900 is the resulting year the date has after this method executes.

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.