Equinox Online Help - Language Reference - A to Z

Home

Dayofweek

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

This function calculates the day of the week from DateExpression and returns it as a number. The returned number can take values from one (Monday) to seven (Sunday) inclusive.

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

This example calculates one month from today and then ensures that the resulting date is on the same day of the week.

nxmonth = Dmyadd(Today, , 1)
nxmonth = nxmonth + Dayofweek(Today) - Dayofweek(nxmonth)