Equinox Online Help - Language Reference - A to Z

Home

Day

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

This function extracts the day value from DateExpression and returns it as a number. The returned day number can take values from 1 to 31 inclusive.

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

This example calculates the next pay date for a new employee. It is this month if the salaries have not yet been paid, or next month otherwise. Note that payday is a number between 1 and 31 and nextpaydate is a date.

nextpaydate = Dmy(payday, Today, Today)

if Day(Today) > payday then
nextpaydate = Dmyadd(nextpaydate, , 1)
end if

The next 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.

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