STD.Date.YearWeekNumFromDate( date, startingDayOfWeek)
date | The date (in Date_t format) for which to compute the week number. |
startingDayOfWeek | Optional, The index number of the first day of a week, 1-7, where 1 = Sunday. Default is 1. |
Return: | The 1-based week number of the date, relative to the beginning of the date's year. |
The YearWeekNumFromDate function returns the 1-based week number of a date within the date's year. Week 1 always contains the first day of the year, and week 2 begins on the following day of the week indicated by the value of startingDayOfWeek.
This is not an ISO-8601 implementation of computing week numbers ("week dates").
Example:
IMPORT STD; startDate := STD.Date.Today(); weekNum := STD.Date.YearWeekNumFromDate(startDate,2); weekNum;
See Also: MonthWeekNumFromDate