Click or drag to resize

CMonth Function

X#
Extract the name of the month from a date.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION CMonth(
	dDate AS DATE
) AS STRING
Request Example View Source

Parameters

dDate
Type: Date
The date from which to extract the month of the date.

Return Value

Type: String
The name of the month, where the first letter is uppercase and the rest of the string is lowercase.
For an invalid or NULL_DATE, CMonth() returns a NULL_STRING.
Remarks
CMonth() is a date conversion function useful for creating formatted date strings that can be used in reports, labels, screens, and so on.
This function is nation-dependent.
Examples
These examples illustrate CMonth():
X#
1? CMonth(Today())                    // September
2? CMonth(Today() + 45)                // October
3? Substr3(CMonth(Today()), 1, 3) +;
4    Str(Day(Today()))            // Sep 1
See Also