Date.IsInYearToDate
語法
Date.IsInYearToDate(dateTime as any) as nullable logical
關於
表示指定的日期時間值 dateTime
是否發生在目前年度,且在當天或當天之前 (由系統目前日期和時間判斷)。
-
dateTime
:要評估的date
、datetime
或datetimezone
值。
範例 1
判斷目前系統時間是否在年初至今。
使用方式
Date.IsInYearToDate(DateTime.FixedLocalNow())
輸出
true