asp.net | Calendar out of range?!

Today I have received the following message while creating a user details page:

Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date), inclusive.
Parameter name: time

I understand what causing the problem is an Arabic calendar (Hijri) is being used for (Gregorian) calendar.

Still looking for the solution.

Solution

Solved by changing the following for ‘ar’ to ‘en’ in Global.asax

 Private Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
       ' Code that runs on application startup                                                            
       'bla bla bla some code
        Else
            System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("en")
            System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en")
        End If

    End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *