Please enable JavaScript to view this site.

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.

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC