System.Globalization.GregorianCalendarHelper.DateToTicks C# (CSharp) Méthode

DateToTicks() static private méthode

static private DateToTicks ( int year, int month, int day ) : long
year int
month int
day int
Résultat long
        internal static long DateToTicks(int year, int month, int day) {
            return (GetAbsoluteDate(year, month,  day)* TicksPerDay);
        }

Usage Example

Exemple #1
0
        // Token: 0x06002E69 RID: 11881 RVA: 0x000B21D4 File Offset: 0x000B03D4
        public DateTime AddMonths(DateTime time, int months)
        {
            if (months < -120000 || months > 120000)
            {
                throw new ArgumentOutOfRangeException("months", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), -120000, 120000));
            }
            this.CheckTicksRange(time.Ticks);
            int num  = this.GetDatePart(time.Ticks, 0);
            int num2 = this.GetDatePart(time.Ticks, 2);
            int num3 = this.GetDatePart(time.Ticks, 3);
            int num4 = num2 - 1 + months;

            if (num4 >= 0)
            {
                num2 = num4 % 12 + 1;
                num += num4 / 12;
            }
            else
            {
                num2 = 12 + (num4 + 1) % 12;
                num += (num4 - 11) / 12;
            }
            int[] array = (num % 4 == 0 && (num % 100 != 0 || num % 400 == 0)) ? GregorianCalendarHelper.DaysToMonth366 : GregorianCalendarHelper.DaysToMonth365;
            int   num5  = array[num2] - array[num2 - 1];

            if (num3 > num5)
            {
                num3 = num5;
            }
            long ticks = GregorianCalendarHelper.DateToTicks(num, num2, num3) + time.Ticks % 864000000000L;

            Calendar.CheckAddResult(ticks, this.m_Cal.MinSupportedDateTime, this.m_Cal.MaxSupportedDateTime);
            return(new DateTime(ticks));
        }
All Usage Examples Of System.Globalization.GregorianCalendarHelper::DateToTicks