Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAbsoluteDate()

static long System.Globalization.GregorianCalendar.GetAbsoluteDate ( int year,
int month,
int day )
inlinestaticpackage

Definition at line 90 of file GregorianCalendar.cs.

91 {
92 if (year >= 1 && year <= 9999 && month >= 1 && month <= 12)
93 {
94 int[] array = ((year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? DaysToMonth366 : DaysToMonth365);
95 if (day >= 1 && day <= array[month] - array[month - 1])
96 {
97 int num = year - 1;
98 return num * 365 + num / 4 - num / 100 + num / 400 + array[month - 1] + day - 1;
99 }
100 }
101 throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadYearMonthDay);
102 }

References System.SR.ArgumentOutOfRange_BadYearMonthDay, System.array, System.Globalization.GregorianCalendar.DaysToMonth365, System.Globalization.GregorianCalendar.DaysToMonth366, and System.year.

Referenced by System.Globalization.GregorianCalendar.DateToTicks(), System.Globalization.UmAlQuraCalendar.GetAbsoluteDateUmAlQura(), and System.Globalization.HebrewCalendar.GetDatePart().