/
//
// 函数功能:返回该年,月的最大天数
// 参数: sMonth 年月串(如:'200203')
// 返回值:返回天数
//
/
int TfrmCardSearch::GetMaxDaysOfMonth(char* sMonth)
{
char month[7];
char submonth[3];
char subyear[5];
int count;
int intyear;
int intmonth;
wsprintf(month,"%s",sMonth);
memcpy(submonth,month+4,2);
submonth[2] = 0;
intmonth = atoi(submonth);
memcpy(subyear,month,4);
subyear[4] = 0;
intyear = atoi(subyear);
switch(intmonth){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
count=31;
break;
case 4:
case 6:
case 9:
case 11:
count=30;
break;
case 2:
if((intyear%4==0&&intyear%100!=0)||(intyear%400==0))
count=29;
else count=28;
break;
}
return count;
}
//---------------------------------------------------------------------------