Equinox Online Help - Language Reference - A to Z

Home

Month

Applies to
SyntaxMonth(DateExpression)
Action[Function] Returns the month value from a specified date.
ScopeUsable anywhere.
Notes

The function extracts the month number from DateExpression and returns it as a number. The returned number can take values from 1 to 12 inclusive.

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

The following example puts the current month into MonthNum.

MonthNum = Month(Today)

The next example sets up the variables EndYear and EndPoint for a project task. The EndPoint value 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