yeartodate - 指令碼與圖表函數
此功能會尋找輸入時間戳記是否位於前次載入指令碼之日期的年份內,並傳回 True (如果在其內),False (如果不在其內)。
語法:
YearToDate(timestamp[ , yearoffset [ , firstmonth [ , todaydate] ] ])
傳回的資料類型: 布林
如未使用任何選用參數,年初至今表示是從 1 月 1 日起,在一個日曆年內的任何日期,但不超過 (可包含) 上次指令碼執行的日期。
引數:
引數 | 描述 |
---|---|
timestamp |
要評估的時間戳記,例如 '2012-10-12'。 |
yearoffset |
透過指定 yearoffset,yeartodate 針對另一年中的相同期間傳回 True。負數 yearoffset 表示前一年,正數是未來年的位移。最新的年結束日期透過指定 yearoffset = -1 實現。如果省略,則採用 0。 |
firstmonth |
透過指定 firstmonth 介於 1 和 12 之間 (如果省略,則為 1),可將年開始向前移到任何月份的第一天。例如,如果要使用起始於 5 月 1 日的會計年度,可指定 firstmonth = 5。 |
todaydate | 透過指定 todaydate (如果省略,則為上次指令碼執行的時間戳記),即可移動作為期間上限的日期。 |