I'm currently going through the globalization process for a project (a .net mvc2 app), and globalization is a bit new to me. I've noticed that DateTime.ToString(), when formatted for some cultures, can cause an ArgumentOutOfRangeException for values too far in the past or future. In particular, the calendars used for "ar" and "ar-SA" (UmAlQuraCalendar) have very limited minimum and maximum supported dates. When using UmAlQuraCalendar, any date before April 1930 or after May 2029 will cause this. This is easily observable:
DateTime.ParseExact("1900", "yyyy", CultureInfo.InvariantCulture).ToString("G", new CultureInfo("ar"));
Forgive my ignorance on the subject, but I'm wondering what the best practice is here. I would like it if I could represent dates earlier than 1930 without having to add exception handling every time I print a date, but I would also like to respect the user's culture. Is the best option here to switch calendars for these cultures? It seems from some googling that the the optionally provided HijriCalendar is very similar to UmAlQuraCalendar, but with much more relaxed minimum and maximum supported dates. Is this a problem a lot of people encounter? I haven't been able to find much advice this this particular issue. I'm hesitant to simply change the default calendar used in these cultures on a whim, without some advice.