jdn_islamic

Description

jdn_islamic converts a provided Julian Day Number (i.e. the number of days since January 1 in the year 4713 BC) to the Islamic (Hijri) date.

This routine is based on a set of C-programs called IslamicTimer, written by Waleed Muhanna.

Gory Details

Given a julian day number, this routine computes the corresponding Hijri date. As a reference point, the routine uses the fact that the year 1405 A.H. started immediatly after lunar conjunction number 1048 which occured on September 1984 25d 3h 10m UT.

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

Code section

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

See also

Notes, Operators, islamic_jdn, visibility, Islamic calendar, islamic_monthName, IslamicTimer

Last update

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.
mail me
Kees Couprie
Other pages by the same author.