• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/wxWidgets-2.8.12/src/common/

Lines Matching refs:year

355 // get the number of days in the given month of the given year
357 wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month)
367 return daysInMonth[wxDateTime::IsLeapYear(year)][month];
406 int year)
412 (year > JDN_0_YEAR) ||
413 ((year == JDN_0_YEAR) && (mon > JDN_0_MONTH)) ||
414 ((year == JDN_0_YEAR) && (mon == JDN_0_MONTH) && (day >= JDN_0_DAY)),
418 // make the year positive to avoid problems with negative numbers division
419 year += 4800;
430 year--;
434 return ((year / 100) * DAYS_PER_400_YEARS) / 4
435 + ((year % 100) * DAYS_PER_4_YEARS) / 4
498 // if year and/or month have invalid values, replace them with the current ones
499 static void ReplaceDefaultYearMonthWithCurrent(int *year,
505 if ( *year == wxDateTime::Inv_Year )
509 *year = 1900 + tmNow->tm_year;
529 tm.tm_year = 76; // any valid year
641 year = (wxDateTime_t)wxDateTime::Inv_Year;
657 year = 1900 + tm.tm_year;
665 return (year != wxDateTime::Inv_Year) && (mon != wxDateTime::Inv_Month) &&
666 (mday <= GetNumOfDaysInMonth(year, mon)) &&
672 // compute the week day from day/month/year: we use the dumbest algorithm
675 wday = (wxDateTime::wxDateTime_t)((GetTruncatedJDN(mday, mon, year) + 2) % 7);
683 year--;
690 year++;
710 dayDiff += GetNumOfDaysInMonth(year, mon);
714 while ( mday > GetNumOfDaysInMonth(year, mon) )
716 mday -= GetNumOfDaysInMonth(year, mon);
721 wxASSERT_MSG( mday > 0 && mday <= GetNumOfDaysInMonth(year, mon),
786 bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal)
788 if ( year == Inv_Year )
789 year = GetCurrentYear();
797 return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
802 return year % 4 == 0;
813 int wxDateTime::GetCentury(int year)
815 return year > 0 ? year / 100 : year / 100 - 1;
819 int wxDateTime::ConvertYearToBC(int year)
821 // year 0 is BC 1
822 return year > 0 ? year : year - 1;
866 wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(int year, Calendar cal)
868 if ( year == Inv_Year )
870 // take the current year if none given
871 year = GetCurrentYear();
878 return IsLeapYear(year) ? 366 : 365;
890 int year,
897 if ( year == Inv_Year )
899 // take the current year if none given
900 year = GetCurrentYear();
903 return GetNumOfDaysInMonth(year, month);
1132 bool wxDateTime::IsDSTApplicable(int year, Country country)
1134 if ( year == Inv_Year )
1136 // take the current year if none given
1137 year = GetCurrentYear();
1151 return year >= 1966 ||
1152 (year >= 1942 && year <= 1945) ||
1153 (year == 1918 || year == 1919);
1157 return year > 1950;
1162 wxDateTime wxDateTime::GetBeginDST(int year, Country country)
1164 if ( year == Inv_Year )
1166 // take the current year if none given
1167 year = GetCurrentYear();
1175 if ( !IsDSTApplicable(year, country) )
1185 if ( !dt.SetToLastWeekDay(Sun, Mar, year) )
1199 switch ( year )
1203 // don't know for sure - assume it was in effect all year
1208 dt.Set(1, Jan, year);
1213 dt.Set(2, Feb, year);
1229 if ( year < 1986 )
1231 if ( !dt.SetToLastWeekDay(Sun, Apr, year) )
1237 else if ( year > 2006 )
1242 if ( !dt.SetToWeekDay(Sun, 2, Mar, year) )
1250 if ( !dt.SetToWeekDay(Sun, 1, Apr, year) )
1267 dt.Set(30, Mar, year);
1274 wxDateTime wxDateTime::GetEndDST(int year, Country country)
1276 if ( year == Inv_Year )
1278 // take the current year if none given
1279 year = GetCurrentYear();
1287 if ( !IsDSTApplicable(year, country) )
1297 if ( !dt.SetToLastWeekDay(Sun, Oct, year) )
1311 switch ( year )
1315 // don't know for sure - assume it was in effect all year
1319 dt.Set(31, Dec, year);
1324 dt.Set(30, Sep, year);
1327 default: // default for switch (year)
1328 if ( year > 2006 )
1333 if ( !dt.SetToWeekDay(Sun, 1, Nov, year) )
1343 if ( !dt.SetToLastWeekDay(Sun, Oct, year) )
1358 dt.Set(26, Oct, year);
1446 int year,
1458 ReplaceDefaultYearMonthWithCurrent(&year, &month);
1460 wxDATETIME_CHECK( (0 < day) && (day <= GetNumberOfDays(month, year)),
1467 // test only the year instead of testing for the exact end of the Unix
1469 if ( year >= yearMinInRange && year <= yearMaxInRange )
1474 tm.tm_year = year - 1900;
1496 m_time = GetTruncatedJDN(day, month, year);
1553 // Y = year offset from 1980 (0-127)
1566 long year = ddt & 0xFE000000;
1567 year >>= 25;
1568 year += 80;
1569 tm.tm_year = year;
1602 long year = tm->tm_year;
1603 year -= 80;
1604 year <<= 25;
1622 ddt = year | month | day | hour | minute | second;
1697 // this will yield day, month (in 1..12 range) and year
1710 // then the year and day of year (1 <= dayOfYear <= 366)
1712 long year = (century * 100) + (temp / DAYS_PER_4_YEARS);
1727 year += 1;
1731 // year is offset by 4800
1732 year -= 4800;
1740 tm.year = (int)year;
1759 wxDateTime& wxDateTime::SetYear(int year)
1764 tm.year = year;
1844 tm.year += diff.GetYears();
1848 if ( tm.mday > GetNumOfDaysInMonth(tm.year, tm.mon) )
1855 // Jan 30 + 1 month be - Feb 28 too or Feb 27 (assuming non leap year)?
1857 tm.mday = GetNumOfDaysInMonth(tm.year, tm.mon);
1882 wxDateTime::SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay wd)
1887 // Jan 4 always lies in the 1st week of the year
1888 wxDateTime dt(4, Jan, year);
1899 SetToTheWeek(int year,
1904 // Jan 4 always lies in the 1st week of the year
1905 wxDateTime dt(4, wxDateTime::Jan, year);
1916 int year = GetYear();
1917 *this = ::SetToTheWeek(year, numWeek, weekday, flags);
1918 if ( GetYear() != year )
1936 int year)
1938 // take the current month/year if none specified
1939 if ( year == Inv_Year )
1940 year = GetYear();
1944 return Set(GetNumOfDaysInMonth(year, month), month, year);
2038 int year)
2045 // take the current month/year if none specified
2046 ReplaceDefaultYearMonthWithCurrent(&year, &month);
2055 dt.Set(1, month, year);
2073 dt.SetToLastMonthDay(month, year);
2106 return (wxDateTime::wxDateTime_t)(gs_cumulatedDays[wxDateTime::IsLeapYear(tm.year)][tm.mon] + tm.mday);
2143 // Week 01 of a year is per definition the first week that has the
2144 // Thursday in this year, which is equivalent to the week that
2146 // week of a new year is the week that has the majority of its
2147 // days in the new year. Week 01 might also contain days from the
2148 // previous year and the week before week 01 of a year is the last
2149 // week (52 or 53) of the previous year even if it contains days
2150 // from the new year. A week starts with Monday (day 1) and ends
2154 // if Jan 1 is Thursday or less, it is in the first week of this year
2160 // be careful to check for overflow in the next year
2164 else // Jan 1 is in the last week of the previous year
2166 // check if we happen to be at the last week of previous year:
2181 const wxDateTime dateFirst = wxDateTime(1, tm.mon, tm.year);
2201 int year = GetYear();
2202 wxDATETIME_CHECK( (0 < yday) && (yday <= GetNumberOfDays(year)),
2203 _T("invalid year day") );
2205 bool isLeap = IsLeapYear(year);
2213 Set((wxDateTime::wxDateTime_t)(yday - gs_cumulatedDays[isLeap][mon]), mon, year);
2233 // March 1 of the year 0 is Rata Die day -306 and JDN 1721119.5
2259 int year = GetYear();
2261 if ( !IsDSTApplicable(year, country) )
2263 // no DST time in this year in this country
2267 return IsBetween(GetBeginDST(year, country), GetEndDST(year, country));
2389 case _T('Y'): // year has 4 digits
2393 case _T('j'): // day of year has 3 digits
2439 // find the YEAR which is a year in the strftime() range (1970
2441 // of the real year. Then make a copy of the format and
2444 // strftime() to format the date in year YEAR and then replace
2445 // YEAR back by the real year and the unique replacement
2450 // fields which may change between the YEAR and real year. For
2455 // find the YEAR: normally, for any year X, Jan 1 or the
2456 // year X + 28 is the same weekday as Jan 1 of X (because
2469 int year;
2472 year = 1988 + mod28; // 1988 == 0 (mod 28)
2476 year = 1970 + mod28 - 10; // 1970 == 10 (mod 28)
2479 int nCentury = year / 100,
2491 // (indirectly) set the year correctly
2494 nLostWeekDays += year++ % 4 ? 1 : 2;
2497 // Keep year below 2000 so the 2digit year number
2499 if (year>=2000) year-=28;
2501 wxASSERT_MSG( year < 2030,
2505 strYear.Printf(_T("%d"), year);
2506 strYear2.Printf(_T("%d"), year % 100);
2528 // replace all occurrences of year with it
2534 // year
2538 // corresponding to Feb 29 of a non leap year (which
2539 // may happen if yearReal was leap and year is not)
2549 tmAdjusted.tm_year = year - 1900;
2555 // now replace the occurrence of 1999 with the real year
2556 // we do this in two stages to stop the 2 digit year
2557 // matching any substring of the 4 digit year.
2580 tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec);
2601 case _T('j'): // day of the year
2629 case _T('U'): // week number in the year (Sunday 1st week day)
2633 case _T('W'): // week number in the year (Monday 1st week day)
2652 case _T('y'): // year without century (00-99)
2653 res += wxString::Format(fmt, tm.year % 100);
2656 case _T('Y'): // year with century
2657 res += wxString::Format(fmt, tm.year);
2802 // next is the year
2805 // no year?
2809 int year = *p++ - _T('0');
2813 // should have at least 2 digits in the year
2817 year *= 10;
2818 year += *p++ - _T('0');
2820 // is it a 2 digit year (as per original RFC 822) or a 4 digit one?
2823 year *= 10;
2824 year += *p++ - _T('0');
2832 year *= 10;
2833 year += *p++ - _T('0');
2999 Set(day, mon, year, hour, min, sec);
3196 int year = 0;
3242 case _T('Y'): // year has 4 digits
3246 case _T('j'): // day of year has 3 digits
3326 year = tm.year;
3371 case _T('j'): // day of the year
3516 year = 1900 + tm.tm_year;
3568 year = tm.year;
3628 case _T('y'): // year without century (00-99)
3639 year = (num > 30 ? 1900 : 2000) + (wxDateTime_t)num;
3642 case _T('Y'): // year with century
3650 year = (wxDateTime_t)num;
3698 tm.year = year;
3701 // TODO we don't check here that the values are consistent, if both year
3702 // day and month/day were found, we just ignore the year day and we
3706 if ( mday > GetNumOfDaysInMonth(tm.year, mon) )
3718 if ( yday > GetNumberOfDays(tm.year) )
3720 wxLogDebug(_T("bad year day in wxDateTime::ParseFormat"));
3725 Tm tm2 = wxDateTime(1, Jan, tm.year).SetToYearDay(yday).GetTm();
3865 // determine if it can be a month, day or a year. Of course, there is an
3873 haveYear = false; // the year?
3879 int year = 0;
3910 // this can only be the year
3913 else // may be either day or year
3915 // use a leap year if we don't have the year yet to allow
3919 ? GetNumOfDaysInMonth(haveYear ? year : 1976, mon)
3943 year = (wxDateTime_t)val;
3980 // could possible be the year (doesn't the year come
4054 // precede the month/year
4088 // may be we have month and day instead of day and year?
4096 // we're in the current year then
4097 if ( (year > 0) && (year <= (int)GetNumOfDaysInMonth(Inv_Year, mon)) )
4099 day = (wxDateTime_t)year;
4110 // if we give the year, month and day must be given too
4111 wxLogDebug(_T("ParseDate: day and month should be specified if year is."));
4124 year = GetCurrentYear();
4130 // we find the day before its month/year so we have to redo it now
4131 if ( day > GetNumOfDaysInMonth(year, mon) )
4134 Set(day, mon, year);
4286 // a time span doesn't have a year nor a timezone