Class JdbcDate
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
JdbcDate
Date
של JDBC. למסמכי העזרה של הכיתה הזו, ראו java.sql.Date
.
Methods
שיטה | סוג הערך המוחזר | תיאור קצר |
after(when) | Boolean | למסמכי העזרה של השיטה הזו, ראו
java.sql.Date#after(date) . |
before(when) | Boolean | למסמכי העזרה של השיטה הזו, ראו
java.sql.Date#before(date) . |
getDate() | Integer | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getDate() . |
getMonth() | Integer | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getMonth() . |
getTime() | Integer | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getTime() . |
getYear() | Integer | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getYear() . |
setDate(date) | void | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setDate(int) . |
setMonth(month) | void | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setMonth(int) . |
setTime(milliseconds) | void | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setTime(int) . |
setYear(year) | void | למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setYear(int) . |
מסמכים מפורטים
after(when)
למסמכי העזרה של השיטה הזו, ראו
java.sql.Date#after(date)
.
פרמטרים
חזרה
Boolean
— true
אם התאריך הזה מאוחר יותר מהתאריך שצוין, ורק אם הוא מאוחר יותר. אחרת, הפונקציה מחזירה את הערך false
.
before(when)
למסמכי העזרה של השיטה הזו, ראו
java.sql.Date#before(date)
.
פרמטרים
חזרה
Boolean
— true
אם ורק אם התאריך הזה מוקדם בהכרח מהתאריך שצוין,
false
אחרת.
getDate()
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getDate()
.
חזרה
Integer
– היום בחודש שמיוצג על ידי התאריך הזה. הערך צריך להיות בין 1 ל-31.
getMonth()
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getMonth()
.
חזרה
Integer
— המספר שמייצג את החודש שמכיל את הרגע בזמן שמיוצג על ידי התאריך הזה, או מתחיל בו. הערך המוחזר הוא בין 0 ל-11, כאשר הערך 0 מייצג את ינואר.
getTime()
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getTime()
.
חזרה
Integer
– מספר אלפיות השנייה שחלפו מאז 1 בינואר 1970, 00:00:00 GMT, שמיוצגים בתאריך הזה.
getYear()
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#getYear()
.
חזרה
Integer
– התוצאה של חיסור 1900 מהשנה שמכילה את הרגע בזמן שמיוצג על ידי התאריך הזה, או שמתחילה בו, כפי שהוא מפורש באזור הזמן המקומי.
setDate(date)
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setDate(int)
.
פרמטרים
שם | סוג | תיאור |
date | Integer | היום בחודש שרוצים להגדיר. הערך הוא בין 1 ל-31, ומשתנה לפי הצורך. לדוגמה, אם התאריך היה 30 באפריל והתאריך מוגדר כ-31, המערכת תתייחס אליו כאילו הוא 1 במאי, כי לאפריל יש רק 30 ימים. |
setMonth(month)
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setMonth(int)
.
פרמטרים
שם | סוג | תיאור |
month | Integer | ערך החודש להגדרה. הערך המוחזר הוא בין 0 ל-11, כאשר הערך 0 מייצג את ינואר. |
setTime(milliseconds)
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setTime(int)
.
פרמטרים
שם | סוג | תיאור |
milliseconds | Integer | מספר אלפיות השנייה מאז 1 בינואר 1970, 00:00:00 GMT, שלא חורג מהייצוג של אלפיות השנייה בשנת 8099. מספר שלילי מציין את מספר אלפיות השנייה לפני 1 בינואר 1970, 00:00:00 GMT. |
setYear(year)
למסמכי התיעוד של השיטה הזו, אפשר לעיין ב-
java.sql.Date#setYear(int)
.
פרמטרים
שם | סוג | תיאור |
year | Integer | הערך שבו רוצים להגדיר את השנה. הערך הזה בתוספת 1900 הוא השנה שמתקבלת בתאריך אחרי שהשיטה הזו פועלת. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eJdbcDate\u003c/code\u003e is a JDBC representation of a SQL \u003ccode\u003eDate\u003c/code\u003e and provides methods for date manipulation.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to compare dates (\u003ccode\u003eafter\u003c/code\u003e, \u003ccode\u003ebefore\u003c/code\u003e), retrieve date components (\u003ccode\u003egetDate\u003c/code\u003e, \u003ccode\u003egetMonth\u003c/code\u003e, \u003ccode\u003egetYear\u003c/code\u003e), and get the time in milliseconds (\u003ccode\u003egetTime\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eYou can modify the date using methods like \u003ccode\u003esetDate\u003c/code\u003e, \u003ccode\u003esetMonth\u003c/code\u003e, \u003ccode\u003esetYear\u003c/code\u003e, and \u003ccode\u003esetTime\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDetailed documentation and method parameters are provided for comprehensive understanding and usage.\u003c/p\u003e\n"]]],[],null,["# Class JdbcDate\n\nJdbcDate\n\nA JDBC `Date`. For documentation of this class, see [`java.sql.Date`](https://docs.oracle.com/javase/6/docs/api/java/sql/Date.html). \n\n### Methods\n\n| Method | Return type | Brief description |\n|--------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [after(when)](#after(JdbcDate)) | `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(JdbcDate)) | `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| [getDate()](#getDate()) | `Integer` | For documentation of this method, see [` java.sql.Date#getDate()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getDate()). |\n| [getMonth()](#getMonth()) | `Integer` | For documentation of this method, see [` java.sql.Date#getMonth()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getMonth()). |\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| [getYear()](#getYear()) | `Integer` | For documentation of this method, see [` java.sql.Date#getYear()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getYear()). |\n| [setDate(date)](#setDate(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setDate(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setDate(int)). |\n| [setMonth(month)](#setMonth(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setMonth(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setMonth(int)). |\n| [setTime(milliseconds)](#setTime(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setTime(int)`](https://docs.oracle.com/javase/6/docs/api/java/sql/Date.html#setTime(long)). |\n| [setYear(year)](#setYear(Integer)) | `void` | For documentation of this method, see [` java.sql.Date#setYear(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setYear(int)). |\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` | [JdbcDate](#) | A date to compare to. |\n\n#### Return\n\n\n`Boolean` --- `true` if and only if this date is strictly later than the provided date; `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` | [JdbcDate](#) | A date to compare to. |\n\n#### Return\n\n\n`Boolean` --- `true` if and only if this date is strictly earlier than the provided date;\n`false` otherwise.\n\n*** ** * ** ***\n\n### `get``Date()`\n\nFor documentation of this method, see [`\njava.sql.Date#getDate()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getDate()).\n\n#### Return\n\n\n`Integer` --- The day of the month represented by this date. The value is between 1 and 31.\n\n*** ** * ** ***\n\n### `get``Month()`\n\nFor documentation of this method, see [`\njava.sql.Date#getMonth()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getMonth()).\n\n#### Return\n\n\n`Integer` --- The number representing the month that contains or begins with the instant in time\nrepresented by this date. The value returned is between 0 and 11, with the value 0\nrepresenting January.\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\ndate.\n\n*** ** * ** ***\n\n### `get``Year()`\n\nFor documentation of this method, see [`\njava.sql.Date#getYear()`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#getYear()).\n\n#### Return\n\n\n`Integer` --- The result of subtracting 1900 from the year that contains or begins with the instant\nin time represented by this date, as interpreted in the local time zone.\n\n*** ** * ** ***\n\n### `set``Date(date)`\n\nFor documentation of this method, see [`\njava.sql.Date#setDate(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setDate(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n\n*** ** * ** ***\n\n### `set``Month(month)`\n\nFor documentation of this method, see [`\njava.sql.Date#setMonth(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setMonth(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|-----------|--------------------------------------------------------------------------------------------------------|\n| `month` | `Integer` | The month value to set. The value returned is between 0 and 11, with the value 0 representing January. |\n\n*** ** * ** ***\n\n### `set``Time(milliseconds)`\n\nFor documentation of this method, see [`\njava.sql.Date#setTime(int)`](https://docs.oracle.com/javase/6/docs/api/java/sql/Date.html#setTime(long)).\n\n#### Parameters\n\n| Name | Type | Description |\n|----------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n\n*** ** * ** ***\n\n### `set``Year(year)`\n\nFor documentation of this method, see [`\njava.sql.Date#setYear(int)`](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#setYear(int)).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-----------|---------------------------------------------------------------------------------------------------------------------|\n| `year` | `Integer` | The value to set the year with. This value plus 1900 is the resulting year the date has after this method executes. |"]]