对于非当前日期(DST 2007+):
首先,您需要一个函数来查找一个月中特定工作日的数量:
Public Function NDow(Y As Integer, M As Integer, _
N As Integer, DOW As Integer) As Date
' Returns Date of Nth Day of the Week in Month
NDow = DateSerial(Y, M, (8 - Weekday(DateSerial(Y, M, 1), _
(DOW + 1) Mod 8)) + ((N - 1) * 7))
End Function
Run Code Online (Sandbox Code Playgroud)
然后,您可以检查DST日与以下函数调用:
秋天:NDow(年(新),
11,1,1 )春天:NDow(年(新),3,2,1)
对于当前日期:
调用Windows API函数GetTimeZoneInformation,它将返回带状态的枚举(整数).
我从Chip Pearson的Excel网站上获得了这个代码.