The optional input argument monthcoding determines how the months are represented. The first six months (Tishri trhu Adar or Adar I) are always represented as a positive integer. If monthcoding is a negative number, then the rest of the months (either Adar II thru Elul or Nisan thru Elul, depending on whether the hebrew year is a leap year or not) are represented as a negative integer, where -1 is the last month of the year (Elul), -2 is the last but 1 month (Av) et cetera. See also
This routine uses several helper routines, which are described on ohter pages of this web site.
If you need to know the name of the month, use Hebrew_MonthName
Sub jdn_hebrew(ByVal jdn As Long, _ ByRef iYear As Integer, _ ByRef iMonth As Integer, _ ByRef iDay As Integer, _ Optional ByVal monthcoding As Integer = UnSigned) Dim InputJDN As Long Dim tishri1 As Long Dim LeftOverDays As Long If jdn <= 347997 Then iYear = 0 iMonth = 0 iDay = 0 Else InputJDN = jdn - 347997 iYear = (InputJDN \ 365) + 1 tishri1 = Hebrew_ElapsedCalendarDays(iYear) While (tishri1 > InputJDN) iYear = iYear - 1 tishri1 = Hebrew_ElapsedCalendarDays(iYear) Wend iMonth = 1 LeftOverDays = InputJDN - tishri1 While (LeftOverDays >= Hebrew_LastDayOfMonth(iYear, iMonth)) LeftOverDays = LeftOverDays - Hebrew_LastDayOfMonth(iYear, iMonth) iMonth = iMonth + 1 Wend If Sgn(monthcoding) = Signed Then If iMonth > 6 Then If Hebrew_LeapYear(iYear) Then iMonth = iMonth - 14 Else iMonth = iMonth - 13 End If End If End If iDay = LeftOverDays + 1 End If End Sub
| 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. |
Kees Couprie |
Other pages by the same author. |