这篇教程C++ IsLeapYear函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中IsLeapYear函数的典型用法代码示例。如果您正苦于以下问题:C++ IsLeapYear函数的具体用法?C++ IsLeapYear怎么用?C++ IsLeapYear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了IsLeapYear函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetDateFromTimeValueint DateTime::DayOfYear() const{ int year, month, day; GetDateFromTimeValue( Value(), year, month, day); const unsigned* monthTable = IsLeapYear(year) ? monthStartLeap : monthStart; return monthTable[ month - 1 ] + day;}
开发者ID:nettashani,项目名称:annotation-and-image-markup,代码行数:8,
示例2: DecodeDateint TDateTime::IsLeapYear(){ unsigned int year=0; unsigned int month=0; unsigned int day=0; DecodeDate(year, month, day); return IsLeapYear(year);}
开发者ID:zhangchaoyangaisino,项目名称:CJ_FWSK_MIDDLEWARE_1.0000,代码行数:8,
示例3: DayFromMonth static double DayFromMonth(double year, double month) { int iMonth = (int) MathUtils::floor(month); if (iMonth < 0 || iMonth >= 12) { return MathUtils::kNaN; } return DayFromYear((int)year) + kMonthOffset[(int)IsLeapYear((int)year)][iMonth]; }
开发者ID:bsdf,项目名称:trx,代码行数:8,
示例4: DayOfYear int Date::DayOfYear(int year, int month, int day) { static const int DAYS_BEFORE[2][13] = { { -1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }, { -1, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 } }; return DAYS_BEFORE[IsLeapYear(year)][month] + day - 1; }
开发者ID:haroldzmli,项目名称:cuboid,代码行数:9,
示例5: DaysInMonth int Date::DaysInMonth(int year, int month) { static const int DAYS_IN_MONTH[2][13] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; return DAYS_IN_MONTH[IsLeapYear(year)][month]; }
开发者ID:haroldzmli,项目名称:cuboid,代码行数:9,
示例6: GetAfterTwoMonthDayCalendar Calendar::GetAfterTwoMonthDay() const { if (this->Month == 12) { if (!IsLeapYear(this->Year + 1)) return this->Day >= 28 ? Calendar(this->Year + 1, 2, 28) : Calendar(this->Year + 1, 2, this->Day); else return this->Day >= 29 ? Calendar(this->Year + 1, 2, 29) : Calendar(this->Year + 1, 2, this->Day); } else if (this->Month == 11) return Calendar(this->Year + 1, 1, this->Day); else if (this->Month == 7 && this->Day == 31) return Calendar(this->Year, 9, 30); else return Calendar(this->Year, this->Month + 2, this->Day);}
开发者ID:AinoMegumi,项目名称:WeAreTokyoRevenueInspectionUnit,代码行数:9,
示例7: CalendarCalendar Calendar::GetAfterAWeekDay() const { auto AfterAWeekDate = [this](const int AbleToSimpleAddBorderDay) { return this->Day <= AbleToSimpleAddBorderDay ? Calendar(this->Year, this->Month, this->Day + 7) : Calendar(this->Year, Month + 1, this->Day - AbleToSimpleAddBorderDay); }; if (this->Month == 12 && this->Day > 24) return Calendar(this->Year + 1, 1, this->Day - 24); else if (!IsNo31Month(this->Month)) return AfterAWeekDate(24); else if (this->Month != 2) return AfterAWeekDate(23); else return AfterAWeekDate((IsLeapYear(this->Year) ? 22 : 21));}
开发者ID:AinoMegumi,项目名称:WeAreTokyoRevenueInspectionUnit,代码行数:9,
示例8: DaysInYearint32 FDateTime::DaysInYear( int32 Year ){ if (IsLeapYear(Year)) { return 366; } return 365;}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:9,
示例9: NextDayvoid NextDay(){day++;if(day>DayOfMonth[month][IsLeapYear(year)]){day=1;month++;}if(month>12){month=1;year++;}}
开发者ID:KeyOfSpectator,项目名称:PAT_old,代码行数:9,
示例10: ValidDaySTATICBOOLEANValidDay ( IN EFI_TIME time ){ if (time.Day > DayOfMonth[time.Month - 1]) { return FALSE; } // // Pay attention to month==2 // if (time.Month == 2 && ((IsLeapYear (time) && time.Day > 29) || (!IsLeapYear (time) && time.Day > 28))) { return FALSE; } return TRUE;}
开发者ID:DYX884877791,项目名称:edk-Shell,代码行数:18,
示例11: MonthDayMax// ////////////////////////////////////////////////////////////////////////////inline unsigned int MonthDayMax(unsigned int in_year, unsigned int in_month){ return((!YearMonthOk(in_year, in_month)) ? 0 : (((in_month == 1) || (in_month == 3) || (in_month == 5) || (in_month == 7) || (in_month == 8) || (in_month == 10) || (in_month == 12)) ? 31 : ((in_month == 4) || (in_month == 6) || (in_month == 9) || (in_month == 11)) ? 30 : (28 + ((IsLeapYear(in_year)) ? 1 : 0))));}
开发者ID:mlbrock,项目名称:MlbDev,代码行数:10,
示例12: IsDayValidSTATICBOOLEANEFIAPIIsDayValid ( IN EFI_TIME *Time ){ ASSERT (Time->Day >= 1); ASSERT (Time->Day <= mDayOfMonth[Time->Month - 1]); ASSERT (Time->Month != 2 || IsLeapYear (Time) || Time->Day <= 28); if (Time->Day < 1 || Time->Day > mDayOfMonth[Time->Month - 1] || (Time->Month == 2 && !IsLeapYear (Time) && Time->Day > 28)) { return FALSE; } return TRUE;}
开发者ID:lersek,项目名称:edk2,代码行数:18,
示例13: MonthDaysint CMyCalendar::MonthDays(int year,int month){ if(month==2) { if(IsLeapYear(year)) return 29; return 28; } return sMonthDays[month];}
开发者ID:almondyoung,项目名称:MyLibOfMySelf,代码行数:10,
示例14: IsLeapYearunsigned CTimer::GetDaysOfMonth (unsigned nMonth, unsigned nYear){ if ( nMonth == 1 && IsLeapYear (nYear)) { return 29; } return s_nDaysOfMonth[nMonth];}
开发者ID:rollingstone,项目名称:circle,代码行数:10,
示例15: switch//returns the length of any month, ie length of November would be 30int cTimeAndDate::LengthOfMonth(int month) const { int ret=-1; switch(month) { case 9: case 4: case 6: case 11: ret=30; break; case 1: case 3: case 5: case 7: case 8: case 10: case 12: ret=31; break; case 2: if(IsLeapYear()) ret=29; else ret=28; break; default: ret=-1; //invalid month } return ret;}
开发者ID:cmd184psu,项目名称:fs-tools,代码行数:11,
示例16: RtlTimeFieldsToTime |