-1

I have Hijri date 25-04-1440 that I want to convert to Gregorian date using C#.

How can I do that?

Tanveer Badar
  • 5,438
  • 2
  • 27
  • 32
Rak
  • 53
  • 8
  • Possible duplicate of [Cannot convert from Hijri Date to Gregorian date (c#)](https://stackoverflow.com/questions/11189807/cannot-convert-from-hijri-date-to-gregorian-date-c) – Tanveer Badar Nov 24 '19 at 14:09

1 Answers1

0

Is this something like given homework, because it seems like one and please search other similar questions, because i am pretty sure this is a duplicate, but anyways, here is my answer. First of all, I am not professional about Hijri dates and their conversion, but during the web search, I found the formula for the conversion between those calendars. First, I think we need to get the year from calendar-type data to integer (the first of June 2019 is 2019,5 and so). Then you can convert them using the following formulas: HD = (GD - 622) * 33 / 32 to get Hijri to Gregorian, and: GD = HD + 622 - (HD / 32) to get Gregorian to Hijri. On the formulas, HD refers to Hijri date and GD to Gregorian date. Then reverse the first step, but using the given integer. If you did it correctly and I described/understanded it correctly, the result must be something like 2019. Sorry for the lack of c# code, its quite simple tho. Source: wikipedia.

duh
  • 3
  • 4