|
|
|
Click here to copy the following block |
Function GetRoshHashanah(ByVal iYear As Integer) As Date Dim dDate As Single, iDate As Integer, iDayOfWeek As Integer Dim JY, JtoG, iMonth As Integer
Const F1 As Single = 765433 / 492480 Const F2 As Single = 23269 / 25920 Const F3 As Single = 765433 / 492480
JY = (12 * ((iYear Mod 19) + 1)) Mod 19
JtoG = iYear \ 100 - iYear \ 400 - 2
dDate = JtoG + F1 * JY + (iYear Mod 4) / 4 - (313 * CLng(iYear) + 89081) / _ 98496
iDate = CInt(Math.Floor(dDate)) dDate = dDate - iDate
If iDate > 30 Then iDate = iDate - 30 iMonth = 10 ElseIf iDate < 1 Then iDate = iDate + 31 iMonth = 8 Else iMonth = 9 End If
iDayOfWeek = (New Date(iYear, iMonth, iDate).DayOfWeek) + 1
If iDayOfWeek = 1 OrElse iDayOfWeek = 4 OrElse iDayOfWeek = 6 Then iDate = iDate + 1 ElseIf iDayOfWeek = 2 AndAlso dDate > F1 AndAlso JY > 11 Then iDate = iDate + 1 ElseIf iDayOfWeek = 3 AndAlso dDate >= F2 AndAlso JY > 6 Then iDate = iDate + 2 End If
If iDate > 30 Then iDate = iDate - 30 iMonth = 10 ElseIf iDate < 1 Then iDate = iDate + 31 iMonth = 8 Else iMonth = 9 End If
Return New Date(iYear, iMonth, iDate) End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
 |

|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|