Returns the week number for the specified date.
int GetWeekOfYear(DateTime date; [int calendarWeekRule]; [int startOfWeek])
date |
The date to find the week number for. |
calendarWeekRule |
Optional rule for defining week one of a year. FirstDay = 0, FirstFullWeek = 1, FirstFourDayWeek = 2 (default) |
startOfWeek |
Optional rule for defining the first day of a week. Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6 |
Example
GetWeekOfYear(Date("2023-12-31")
Returns 52.