コード例 #1
0
        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));
        }
コード例 #2
0
 internal long GetTickOfDay(LocalInstant localInstant)
 {
     return(TimeOfDayCalculator.GetTickOfDay(localInstant));
 }