+ Date Equations
+ A given time _t_ belongs to day number
+ EpochTimeToDayNumber(_t_) = floor(_t_ / ℝ(msPerDay))
+ Number of days in year are given by:
+
+ MathematicalDaysInYear(_y_)
+ = 365 if ((_y_) modulo 4) ≠ 0
+ = 366 if ((_y_) modulo 4) = 0 and ((_y_) modulo 100) ≠ 0
+ = 365 if ((_y_) modulo 100) = 0 and ((_y_) modulo 400) ≠ 0
+ = 366 if ((_y_) modulo 400) = 0
+
+ The day number of the first day of year _y_ is given by:
+ EpochDayNumberForYear(_y_) = 365 × (_y_ - 1970) + floor((_y_ - 1969) / 4) - floor((_y_ - 1901) / 100) + floor((_y_ - 1601) / 400)
+ The time of the start of a year is:
+ EpochTimeForYear(_y_) = ℝ(msPerDay) × EpochDayNumberForYear(_y_)
+ Epoch year from time _t_ is given by:
+ EpochTimeToEpochYear(_t_) = the largest integral Number _y_ (closest to +∞) such that EpochTimeForYear(_y_) ≤ _t_
+ The following function returns 1 for a time within leap year otherwise it returns 0:
+
+ MathematicalInLeapYear(_t_)
+ = 0 if MathematicalDaysInYear(EpochTimeToEpochYear(_t_)) is 365
+ = 1 if MathematicalDaysInYear(EpochTimeToEpochYear(_t_)) is 366
+
+ The month number for a time _t_ is given by:
+
+ EpochTimeToMonthInYear(_t_)
+ = 0 if 0 ≤ EpochTimeToDayInYear(_t_) < 31
+ = 1 if 31 ≤ EpochTimeToDayInYear(_t_) < 59 + MathematicalInLeapYear(_t_)
+ = 2 if 59 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 90 + MathematicalInLeapYear(_t_)
+ = 3 if 90 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 120 + MathematicalInLeapYear(_t_)
+ = 4 if 120 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 151 + MathematicalInLeapYear(_t_)
+ = 5 if 151 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 181 + MathematicalInLeapYear(_t_)
+ = 6 if 181 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 212 + MathematicalInLeapYear(_t_)
+ = 7 if 212 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 243 + MathematicalInLeapYear(_t_)
+ = 8 if 243 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 273 + MathematicalInLeapYear(_t_)
+ = 9 if 273 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 304 + MathematicalInLeapYear(_t_)
+ = 10 if 304 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 334 + MathematicalInLeapYear(_t_)
+ = 11 if 334 + MathematicalInLeapYear(_t_) ≤ EpochTimeToDayInYear(_t_) < 365 + MathematicalInLeapYear(_t_)
+
+ where
+ EpochTimeToDayInYear(_t_) = EpochTimeToDayNumber(_t_) - EpochDayNumberForYear(EpochTimeToEpochYear(_t_))
+ A month value of 0 specifies January; 1 specifies February; 2 specifies March; 3 specifies April; 4 specifies May; 5 specifies June; 6 specifies July; 7 specifies August; 8 specifies September; 9 specifies October; 10 specifies November; and 11 specifies December. Note that EpochTimeToMonthInYear(0) = 0, corresponding to Thursday, 1 January 1970.
+ The date number for a time _t_ is given by:
+
+ EpochTimeToDate(_t_)
+ = EpochTimeToDayInYear(_t_) + 1 if EpochTimeToMonthInYear(_t_) is 0
+ = EpochTimeToDayInYear(_t_) - 30 if EpochTimeToMonthInYear(_t_) is 1
+ = EpochTimeToDayInYear(_t_) - 58 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 2
+ = EpochTimeToDayInYear(_t_) - 89 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 3
+ = EpochTimeToDayInYear(_t_) - 119 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 4
+ = EpochTimeToDayInYear(_t_) - 150 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 5
+ = EpochTimeToDayInYear(_t_) - 180 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 6
+ = EpochTimeToDayInYear(_t_) - 211 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 7
+ = EpochTimeToDayInYear(_t_) - 242 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 8
+ = EpochTimeToDayInYear(_t_) - 272 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 9
+ = EpochTimeToDayInYear(_t_) - 303 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 10
+ = EpochTimeToDayInYear(_t_) - 333 - MathematicalInLeapYear(_t_) if EpochTimeToMonthInYear(_t_) is 11
+
+ The weekday for a particular time _t_ is defined as:
+ EpochTimeToWeekDay(_t_) =(EpochTimeToDayNumber(_t_) + 4) modulo 7
+ A weekday value of 0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday. Note that EpochTimeToWeekDay(0) = 4, corresponding to Thursday, 1 January 1970.
+ These equations correspond to ECMA-262 equations defined in Year Number, Month Number, Date Number, Week Day respectively. These calculate the result in mathematical values instead of Number values. These equations would be unified when https://github.com/tc39/ecma262/issues/1087 is fixed.
+ Note that the operation EpochTimeToMonthInYear(_t_) uses 0-based months unlike rest of Temporal since it's intended to be unified with MonthFromTime(_t_) when the above mentioned issue is fixed.
+