Click or drag to resize

Month Function

Extract the number of the month from a date.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION Month(
	dDate AS DATE
) AS DWORD
View Source

Parameters

dDate
Type: Date
The date.

Return Value

Type: UInt32
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:
X#
? Today()                                                // 09/01/90
? Month(Today())                                // 9
// Advance by 1 month:
? Month(Today()) + 1                        // 10
This example uses month along with Day() and Year():
X#
?"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:
X#
? Month(NULL_DATE)                                // 0
See Also