2.1.8.20 get_weekday_name


Description

get the string representing the weekday given a number from 0 to 6

Syntax

BOOL get_weekday_name( int nDayOfWeek, int nAbbriv, LPSTR lpszBuff, int nSize )

Parameters

nDayOfWeek
[input] the weekday you want to get name, and -1<nDayOfWeek<7
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 weekday name(upper case)
lpszBuff
[output] the name of the weekday
nSize
[input] size of lpszBuff

Return

false if error, like nDayOfWeek not 0-6 or nAbbriv not one of the value supported

Examples

EX1

void get_weekday_name_ex1()
{
     char pWeekDay[20] = "";
    bool bRet = get_weekday_name(2, -1, pWeekDay, 20);
    out_str(pWeekDay);
    
    bRet = get_weekday_name(1, 0, pWeekDay, 20);
    out_str(pWeekDay);
    
    bRet = get_weekday_name(3, 1, pWeekDay, 20);
    out_str(pWeekDay);
    
    bRet = get_weekday_name(5, 3, pWeekDay, 20);
    out_str(pWeekDay);
}

Remark

See Also

get_month_name

Header to Included

origin.h

Reference