Extract the number of the month from a date.
XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax View Source
dDate AS DATE
) AS DWORD
public static uint Month(
- Type: Date
A number from 0 to 12. Specifying a NULL_DATE returns 0.
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.
These examples return the month of the system date:
? Today() // 09/01/90
? Month(Today()) // 9
// Advance by 1 month:
? Month(Today()) + 1 // 10
This example uses month along with Day() and Year():
?"We are", Year(Today()), "years, ",;
Month(Today()), "months, and", Day(Today()),;
"days into our history!"
This example shows the result when a NULL_DATE is passed: