Enum RelativeDate
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
相對日期
列舉代表相對日期選項,用於計算要在以日期為基礎的 BooleanCriteria
中使用的值。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
SpreadsheetApp.RelativeDate.TODAY
。
屬性
屬性 | 類型 | 說明 |
TODAY | Enum | 與目前日期比較的日期。 |
TOMORROW | Enum | 與目前日期後的日期進行比較的日期。 |
YESTERDAY | Enum | 與目前日期之前的日期進行比較的日期。 |
PAST_WEEK | Enum | 過去一週內的日期。 |
PAST_MONTH | Enum | 過去一個月內的日期。 |
PAST_YEAR | Enum | 過去一年內的日期。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eRelativeDate\u003c/code\u003e is used within \u003ccode\u003eBooleanCriteria\u003c/code\u003e for date-based comparisons in Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt offers various properties like \u003ccode\u003eTODAY\u003c/code\u003e, \u003ccode\u003ePAST_WEEK\u003c/code\u003e, etc., representing different relative date periods.\u003c/p\u003e\n"],["\u003cp\u003eTo use it, call the parent class, name, and property, for example, \u003ccode\u003eSpreadsheetApp.RelativeDate.TODAY\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Enum RelativeDate\n\nRelativeDate\n\nAn enumeration representing the relative date options for calculating a value to be used in\ndate-based [BooleanCriteria](/apps-script/reference/spreadsheet/boolean-criteria).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nSpreadsheetApp.RelativeDate.TODAY`. \n\n### Properties\n\n| Property | Type | Description |\n|--------------|--------|----------------------------------------------------------|\n| `TODAY` | `Enum` | Dates compared against the current date. |\n| `TOMORROW` | `Enum` | Dates compared against the date after the current date. |\n| `YESTERDAY` | `Enum` | Dates compared against the date before the current date. |\n| `PAST_WEEK` | `Enum` | Dates that fall within the past week period. |\n| `PAST_MONTH` | `Enum` | Dates that fall within the past month period. |\n| `PAST_YEAR` | `Enum` | Dates that fall within the past year period. |"]]