This routine is based on a set of C-programs called IslamicTimer, written by Waleed Muhanna.
jdn_islamic is based on a mathematical representation of the lunar month. Since there is no way to calculate when the moon can actually be seen on a particular place on the earth, the moon is assumed to be visible allways.
jdn_islamic takes one input argument: the Julian Day Number. The other arguments: the Islamic year, the Islamic month and the Islamic day, are output parameters. After calling jdn_islamic these output parameters will contain the Islamic date corresponding with the provided Julian Day Number.
If you need to know the name of the month, use islamic_monthName
Sub jdn_islamic(ByVal jd As Double, _ ByRef iYear As Integer, _ ByRef iMonth As Integer, _ ByRef iDay As Integer) Dim mjd As Double Dim k As Long Dim hm As Long Call jdn_civil(jd, iYear, iMonth, iDay) k = Int(0.6 + (iYear + (CInt(iMonth - 0.5)) / 12# + iDay / 365# - 1900) * 12.3685) Do mjd = visibility(k) k = k - 1 Loop While (mjd > (jd - 0.5)) k = k + 1 hm = k - 1048 iYear = 1405 + Fix(hm / 12) iMonth = (hm Mod 12) + 1 If (hm <> 0 And iMonth <= 0) Then iMonth = iMonth + 12 iYear = iYear - 1 End If If iYear <= 0 Then iYear = iYear - 1 iDay = Int(jd - mjd + 0.5) End Sub
| Julian Day Number: | 2452194 |
| Civil (Gregorian) date: | Thursday, 11 October 2001 |
| Julian date: | Thursday, 28 September 2001 |
| Hebrew date: | yom xamishi, 24 Tishri 5762 |
| Islamic (Hijri) date: | Al-KHamees, 23 Rajab 1422 |
| Persian (Shamsi) date: | Panjshanbeh, 19 Mehr 1380 |
| Back to Calendar Math. |
Kees Couprie |
Other pages by the same author. |