CToMonth()
Convert name of month to its ordinal number
Syntax
CToMonth( <cName> ) -> nOrdinal
Argument
<cName> Designates the name of one of the 12 months.
Returns
CToMonth() returns the number for the designated month name.
Description
Use CToMonth() to change the name of a month into a number. January corresponds to 1, February 2, etc.. If the function returns a 0 value, then an invalid parameter has been passed. If you shorten the month name, use explicit abbreviations to return an accurate return value.
Notes
. Uppercase and lowercase letters do not affect the name of the month. . The function’s operation depends on the country-specific adaptation of your Harbour compiler. With an English version of Harbour, only English month names are recognized.
Examples
. Show the number for January: ? CToMonth("January") // Result: 1 . Show several ways to determine the month number for August: ? CToMonth("AUGUST") // Result: 8 ? CToMonth("August") // Result: 8 ? CToMonth("Au") // Result: 8 . The number for April: ?CToMonth("A") // Result: 4
Compliance
CToMonth() is compatible with CT3’s CToMonth().
Platforms
All
Files
Source is dattime2.prg, library is libct.
Seealso
NToCMonth()