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

◆ ToDateTime() [2/2]

override DateTime System.Globalization.EastAsianLunisolarCalendar.ToDateTime ( int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond,
int era )
inlineinherited

Definition at line 210 of file EastAsianLunisolarCalendar.cs.

211 {
212 year = CheckYearMonthRange(year, month, era);
213 int num = InternalGetDaysInMonth(year, month);
214 if (day < 1 || day > num)
215 {
216 throw new ArgumentOutOfRangeException("day", day, SR.Format(SR.ArgumentOutOfRange_Day, num, month));
217 }
218 if (!LunarToGregorian(year, month, day, out var solarYear, out var solarMonth, out var solarDay))
219 {
220 throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadYearMonthDay);
221 }
222 return new DateTime(solarYear, solarMonth, solarDay, hour, minute, second, millisecond);
223 }
bool LunarToGregorian(int lunarYear, int lunarMonth, int lunarDate, out int solarYear, out int solarMonth, out int solarDay)

References System.SR.ArgumentOutOfRange_BadYearMonthDay, System.SR.ArgumentOutOfRange_Day, System.Globalization.EastAsianLunisolarCalendar.CheckYearMonthRange(), System.DateTime, System.SR.Format(), System.Globalization.EastAsianLunisolarCalendar.InternalGetDaysInMonth(), System.Globalization.EastAsianLunisolarCalendar.LunarToGregorian(), and System.year.