Wrong date in converting Gregorian to Hijri Calendar

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All,
I am trying to convert Gregorian calendar date value to Hijri one.
The test date is 10th May, 2013. The result is "01/07/1434" not "30/06/1434". I am confused...
My test code is: private static void Test(){
DateTime dt;
System.Globalization.DateTimeFormatInfo HijriDTFI;
try{
dt = Convert.ToDateTime("5/10/2013");
HijriDTFI = new System.Globalization.CultureInfo("ar-EG", false).DateTimeFormat;
HijriDTFI.Calendar = new System.Globalization.HijriCalendar();
HijriDTFI.ShortDatePattern = "dd/MM/yyyy";
MessageBox.Show(dt.Date.ToString("f", HijriDTFI));
} catch (Exception e){
MessageBox.Show(e.ToString());
}
}
Is it a defect in Microsoft??
Regards,
James
James

View the full article
 
Back
Top