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

◆ GetAbsoluteDate()

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

Definition at line 155 of file GregorianCalendarHelper.cs.

156 {
157 if (year >= 1 && year <= 9999 && month >= 1 && month <= 12)
158 {
159 int[] array = ((year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? DaysToMonth366 : DaysToMonth365);
160 if (day >= 1 && day <= array[month] - array[month - 1])
161 {
162 int num = year - 1;
163 int num2 = num * 365 + num / 4 - num / 100 + num / 400 + array[month - 1] + day - 1;
164 return num2;
165 }
166 }
167 throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadYearMonthDay);
168 }

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

Referenced by System.Globalization.GregorianCalendarHelper.DateToTicks().