Class JdbcDate Stay organized with collections Save and categorize content based on your preferences.
Page Summary
JdbcDate represents a JDBC
Dateand its documentation refers tojava.sql.Date.It includes methods for comparing dates such as
after()andbefore().Methods like
getDate(),getMonth(),getTime(), andgetYear()allow retrieval of specific date components.You can modify date components using methods like
setDate(),setMonth(),setTime(), andsetYear().
A JDBCDate. For documentation of this class, seejava.sql.Date.
Methods
| Method | Return type | Brief description |
|---|---|---|
after(when) | Boolean | For documentation of this method, seejava.sql.Date#after(date). |
before(when) | Boolean | For documentation of this method, seejava.sql.Date#before(date). |
get | Integer | For documentation of this method, seejava.sql.Date#getDate(). |
get | Integer | For documentation of this method, seejava.sql.Date#getMonth(). |
get | Integer | For documentation of this method, seejava.sql.Date#getTime(). |
get | Integer | For documentation of this method, seejava.sql.Date#getYear(). |
set | void | For documentation of this method, seejava.sql.Date#setDate(int). |
set | void | For documentation of this method, seejava.sql.Date#setMonth(int). |
set | void | For documentation of this method, seejava.sql.Date#setTime(int). |
set | void | For documentation of this method, seejava.sql.Date#setYear(int). |
Detailed documentation
after(when)
For documentation of this method, seejava.sql.Date#after(date).
Parameters
| Name | Type | Description |
|---|---|---|
when | Jdbc | A date to compare to. |
Return
Boolean —true 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
| Name | Type | Description |
|---|---|---|
when | Jdbc | A date to compare to. |
Return
Boolean —true 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
| Name | Type | Description |
|---|---|---|
date | Integer | The 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
| Name | Type | Description |
|---|---|---|
month | Integer | The 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
| Name | Type | Description |
|---|---|---|
milliseconds | Integer | The 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
| Name | Type | Description |
|---|---|---|
year | Integer | The 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.