internal override LocalInstant SetYear(LocalInstant localInstant, int year) { // Optimized implementation of SetYear, due to fixed months. int thisYear = GetYear(localInstant); int dayOfYear = GetDayOfYear(localInstant, thisYear); // Truncate final day of leap year. if (dayOfYear == DaysPerLeapYear && !IsLeapYear(year)) { dayOfYear--; } long tickOfDay = TimeOfDayCalculator.GetTickOfDay(localInstant); return(new LocalInstant(GetStartOfYearInTicks(year) + ((dayOfYear - 1) * NodaConstants.TicksPerStandardDay) + tickOfDay)); }
internal long GetTickOfDay(LocalInstant localInstant) { return(TimeOfDayCalculator.GetTickOfDay(localInstant)); }