julian_jdn

Description

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

Notes

The year zero never existed. the year 1 BC was immediately followed by the year 1 AD. When calling this function, you should be ware that the value 0 for year, means 1 BC, -1 means 2 BC et cetera.

Gory Details

year, month and day are input parameters. julian_jdn calculates and returns the corresponding Julian Day Number.

Code section

Function julian_jdn(ByVal iYear As Integer, _
                    ByVal iMonth As Integer, _
                    ByVal iDay As Integer) As Long
    Dim lYear As Long
    Dim lMonth As Long
    Dim lDay As Long

    lYear = CLng(iYear)
    lMonth = CLng(iMonth)
    lDay = CLng(iDay)

    julian_jdn = 367 * lYear - _
            ((7 * (lYear + 5001 + ((lMonth - 9) \ 7))) \ 4) _
            + ((275 * lMonth) \ 9) + lDay + 1729777

End Function

See also

jdn_julian, Notes, Operators, Claus Tøndering's Calendar Faq.

Last update

Julian Day Number: 2452096
Civil (Gregorian) date: 5 July 2001
Julian date: 22 June 2001
Hebrew date: 14 Tammuz 5761
Islamic date: 13 Rabi' II 1422

Back to Calendar Math.

mail me
Kees Couprie

Other pages by the same author.