Month Function | |
Extract the number of the month from a date.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION Month(
dDate AS DATE
) AS DWORD
public static uint Month(
Date dDate
)
Request Example
View SourceParameters
- dDate
- Type: Date
The date.
Return Value
Type:
DWord
A number from 0 to 12. Specifying a NULL_DATE returns 0.
Remarks
Month() is a date conversion function that is useful when you require a numeric month value during calculations for such things as periodic reports.
Month() is a member of a group of functions that return components of a date value as numbers.
The group includes Day() and Year() to return the day and year values as numerics. CMonth() is a related function that allows you to return the name of the month from a date value.
Examples
These examples return the month of the system date:
1? Today()
2? Month(Today())
3
4? Month(Today()) + 1
This example uses month along with Day() and Year():
1?"We are", Year(Today()), "years, ",;
2 Month(Today()), "months, and", Day(Today()),;
3 "days into our history!"
This example shows the result when a NULL_DATE is passed:
See Also