get_month_name

 

Description

get the string representing the month given a number from 1 to 12

Syntax

BOOL get_month_name( int nMonth, int nAbbriv, LPSTR lpszBuff, int nSize )

Parameters

nMonth
[input] the month you want to get name, and 1<=nMonth<=12
nAbbriv
[input] 0 for full name, 1 for abbrivated string with size one, 3 for abbrivated string with size three, -1 to get English 3 letter month name(upper case)
lpszBuff
[output] the name of the month
nSize
size of lpszBuff

Return

false if error, like nMonth not 1-12 or nAbbriv not one of the value supported

Examples

EX1

void get_month_name_ex1()
{
        char pMonth[20] = "";
        bool bRet = get_month_name(2, -1, pMonth, 20);
        out_str(pMonth);
        
        bRet = get_month_name(1, 0, pMonth, 20);
        out_str(pMonth);
        
        bRet = get_month_name(3, 1, pMonth, 20);
        out_str(pMonth);
        
        bRet = get_month_name(5, 3, pMonth, 20);
        out_str(pMonth);
}

Remark

See Also

header to Include

origin.h

Reference