Custom Function: Week of Year

Returns the Week of Year of the given date, as an integer from 1 - 53.

Remark: Uses the FirstDay week rule, with Sunday as the first day of the week.


  1. dateValue - A Date, DateTime, or date string value to get the week number.


DateTime d = Convert.ToDateTime(args[0]); 
return sessionInfo.PageInfo.CultureInfo.Calendar.GetWeekOfYear(d, System.Globalization.CalendarWeekRule.FirstDay, System.DayOfWeek.Sunday);

Hidden Article Information

Article Author
Exago Development
created 2017-10-31 17:05:56 UTC
updated 2017-10-31 17:09:24 UTC

example, code, datetime, date,
Have more questions? Submit a request