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
Using Persia.NET Core can be of help to you:
Converting Gregorian to Shamsi
Persia.SolarDate solarDate = Persia.Calendar.ConvertToPersian(DateTime.Now);
// getting the simple format of persian date
string str = solarDate.ToString();
Converting Shamsi to Gregorian
DateTime ConvertToGregorian(SolarDate solarDate)
DateTime ConvertToGregorian(LunarDate lunarDate)
DateTime ConvertToGregorian(int year, int month, int day, DateType dateType)
DateTime ConvertToGregorian(int year, int month, int day, int hour, int minute, int
second, DateType dateType)
You can download it here If your application is not supported .NET Core you can find the older version of this from NuGet.