Home | History | Annotate | Download | only in src

Lines Matching full:year

98   bool IsLeap(int year) {
99 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
142 // We solve this by mapping the time to a year with same leap-year-ness
143 // and same starting day for the year. The ECMAscript specification says
145 // the actual year if it is in the range 1970..2037
149 int year, month, day;
150 YearMonthDayFromDays(days, &year, &month, &day);
151 int new_days = DaysFromYearMonth(EquivalentYear(year), month) + day - 1;
155 // Returns an equivalent year in the range [2008-2035] matching
156 // - leap year,
159 int EquivalentYear(int year) {
160 int week_day = Weekday(DaysFromYearMonth(year, 0));
161 int recent_year = (IsLeap(year) ? 1956 : 1967) + (week_day * 12) % 28;
162 // Find the year in the range 2008..2037 that is equivalent mod 28.
168 // the corresponding year, month, and day.
169 void YearMonthDayFromDays(int days, int* year, int* month, int* day);
172 // the first day of the given month in the given year.
173 int DaysFromYearMonth(int year, int month);
250 // Year/Month/Day cache.