Last post Jun 15, 2015 05:58 AM by PatriceSc
Sep 30, 2010 02:29 PM|aspnet_123|LINK
i want to convert gregorian date to hijri date
while convert i get this error mesage.
The DateTime represented by the string is not supported in calendar System.Globalization.HijriCalendar.
Protected Function GregToHijri(ByVal Greg_Date As String) As DateTime
If Session("CalenderType") = "h" Or Session("CalenderType") = "" Then
Dim sa As CultureInfo = New CultureInfo("ar-SA")
Dim Sdate As DateTime = DateTime.ParseExact(Greg_Date, "dd/MM/yyyy", sa.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces)
Jun 15, 2015 05:58 AM|PatriceSc|LINK
For now it seems the problem is you are already trying to read the string date using ar-sa. Instead you likely have to read the string using the culture that was used to create it and only once you have then a datetime, convert this datetime to a string