CToMonth()

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()

Advertisements

2 responses to “CToMonth()

  1. Pingback: Harbour Date & Time Functions | Viva Clipper !

  2. Pingback: Harbour All Functions – C | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s