跳到主要内容

Date.IsInPreviousYear

指示此日期是否会在系统当前日期和时间确定的上一年中出现。请注意,当传递一个在当前年内出现的值时,此函数将返回 false。

Syntax

Date.IsInPreviousYear(
dateTime as any
) as logical

Remarks

指示给定的日期时间值 dateTime 是否会在系统当前日期和时间确定的上一年中出现。请注意,当传递一个在当前年内出现的值时,此函数将返回 false。

  • dateTime: 要计算的 datedatetimedatetimezone 值。

Examples

Example #1

确定当前系统时间之前的那个年度是否处于前一年。

Date.IsInPreviousYear(Date.AddYears(DateTime.FixedLocalNow(), -1))

Result:

true

Category

Date