How to convert a Persian date into a Gregorian date?

前端 未结 9 1225
萌比男神i
萌比男神i 2020-12-30 04:30

I use the function below to convert Gregorian dates to Persian dates, but I\'ve been unable to write a function to do the reverse conversion. I want a function that converts

9条回答
  •  一整个雨季
    2020-12-30 05:15

    Thanks guys,I used below code and my problem solved:

    public static DateTime GetEdate(string _Fdate)
    {
        DateTime fdate = Convert.ToDateTime(_Fdate);
        GregorianCalendar gcalendar = new GregorianCalendar();
        DateTime eDate = pcalendar.ToDateTime(
               gcalendar.GetYear(fdate),
               gcalendar.GetMonth(fdate),
               gcalendar.GetDayOfMonth(fdate),
               gcalendar.GetHour(fdate),
               gcalendar.GetMinute(fdate),
               gcalendar.GetSecond(fdate), 0);
        return eDate;
    }
    

提交回复
热议问题