Returns the calendar week a number
Week( [<dDate>][, <lSWN>] ) -> nWeek
<dDate> Designates a date for which the week it lies in, is determined. The default is the system date.
<lSWN> Simple Week Number ( see below description )
WEEK() returns a sequential week number that designates in which week of the year <dDate> lies.
Week() returns the calendar week a number. If no date is specified, the system date is used. An empty date via hb_SToD(“”) returns 0. The week of the year in which a day lies is information required by a number of technical financial calculations or wage accounting. This function determines this week and acknowledged all calendar rules. If <lSWN> is .T., Week() will calculate the “simple week number”, defined by – week #1 starts on January, 1st – week #(n+1) starts seven days after start of week #n If <lSWN> is .F. (default), the ISO8601 week number, defined by – weeks start on mondays – week #1 is the one that includes January, 4 will be calculated.
. When no date is specified, then WEEK() uses the system date. An empty date leads to a 0 result.
Determine the week for a date: dDate := CTOD("03/14/92") ? "This date is in week: ", WEEK(dDate)
Week() is compatible with CT3’s Week(). <lSWN> is Harbour extention.
Source is dattime2.prg, library is libct.
CDoW(), CToDoW(), DoW()