DatePart

Public Function DatePart(ByVal Interval As String, ByVal InputDate As Date, Optional ByVal FirstDayOfWeek As Long = 0, Optional ByVal FirstWeekOfYear As Long = 0) As Long

Gets an part from a date.

SendDebug $"The current week is {DatePart("ww", Date, vbMonday, vbFirstFourDates)} and we are in quarter {DatePart("q", Date)}"

See also: