Lines Matching defs:year
74 bool IsLeap(int year) {
75 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
118 // We solve this by mapping the time to a year with same leap-year-ness
119 // and same starting day for the year. The ECMAscript specification says
121 // the actual year if it is in the range 1970..2037
125 int year, month, day;
126 YearMonthDayFromDays(days, &year, &month, &day);
127 int new_days = DaysFromYearMonth(EquivalentYear(year), month) + day - 1;
131 // Returns an equivalent year in the range [2008-2035] matching
132 // - leap year,
135 int EquivalentYear(int year) {
136 int week_day = Weekday(DaysFromYearMonth(year, 0));
137 int recent_year = (IsLeap(year) ? 1956 : 1967) + (week_day * 12) % 28;
138 // Find the year in the range 2008..2037 that is equivalent mod 28.
144 // the corresponding year, month, and day.
145 void YearMonthDayFromDays(int days, int* year, int* month, int* day);
148 // the first day of the given month in the given year.
149 int DaysFromYearMonth(int year, int month);
152 void BreakDownTime(int64_t time_ms, int* year, int* month, int* day,
245 // ES6 section 20.3.1.13 MakeDay (year, month, date)
246 double MakeDay(double year, double month, double date);