Cannot convert from Hijri Date to Gregorian date (c#)

后端 未结 3 694
醉梦人生
醉梦人生 2020-12-07 02:05

Now i am working with Hijri dates and trying to convert them to Gregorian dates using the following code :

string HijriDate;
string[] allFormats ={\"yyyy         


        
3条回答
  •  無奈伤痛
    2020-12-07 02:21

    Max Value of a days in a month can be calculated by DateTime.DaysInMonth(year, month)

    and use it this way

    int result = DateTime.DaysInMonth(2012, 2); // returns 29 being a leap year
    

    but

    int result = DateTime.DaysInMonth(2011, 2) // returns 28 being a non-leap year
    

提交回复
热议问题