Equinox Online Help - Language Reference - A to Z

Home

Week

Applies to
SyntaxWeek(DateExpression)
Action[Function] Returns the week of the year for a specified date.
ScopeUsable anywhere.
Notes

The function extracts the week number from DateExpression and returns it as a number. The returned value is in the range 0 to 52 inclusive.

CategoryDate handling
See Also Years, Year, Day, Dayname, Dayofweek, Dayofyear, Dmy, Dmyadd, Leapyear, Month, MonthName, Months, ServerDateTime, Today, WeekOfYear, WeekStart
Example

The following example sets up the variables EndYear and EndPoint for a project task. The value of EndPoint depends on the time unit (days, weeks or months) chosen for the project.

EndYear = Year(EndDate)

Switch TimeUnit
case 7
EndPoint = Week(EndDate)
case 1
EndPoint = Day(EndDate)
case 30
EndPoint = Month(EndDate)
end switch