RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums

Hijri Calendar value in visual basic

Join Date: Jan 2008
Posts: 2
Reputation: abutty is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
abutty abutty is offline Offline
Newbie Poster

Re: Hijri Calendar value in visual basic

  #5  
Jan 11th, 2008
Dear Friends.. Please use the following code




Public Function HijraDate(DateEntry As Date)
HijraDate = HijriUmmulQura(DateEntry)
Dim TDAYS As String
Exit Function
Dim diff As Long, dy As Integer
TDAYS = "Saturday Sunday Monday Tuesday WednesdayThursday Friday "
diff = DateDiff("d", "15/02/1592", DateEntry)
Dim ADJ_DAYS As Integer
Dim X As Integer
Dim d As Integer
Dim M As Integer
Dim XDate1 As Variant
Dim XDate2 As Variant
Dim XDate3 As Variant

ADJ_DAYS = (Int(((diff - 145322) + 950 / 2) / 950)) * -1
ADJ_DAYS = ADJ_DAYS + prgSetup.ADayDiff
dy = diff - Int(diff / 7) * 7
X = diff + ADJ_DAYS
d = Int(((X / 29.5) - Int(X / 29.5)) * 29.5)
M = Int((((X / 354) - Int(X / 354)) * 354) / 29.5)
XDate1 = Right(Str(100 + d + IIf(d = 0, 30, 0)), 2)
XDate2 = Right(Str(100 + M + IIf(M = 0, 12, 0) - IIf(d = 0, 1, 0)), 2)
XDate3 = Str(1000 + Int(X / 354) - IIf(M = 0, 1, 0))
If XDate2 = "00" Then XDate3 = Str(Val(XDate3) - 1)
If XDate2 = "00" Then XDate2 = "12"
If XDate2 = "02" And XDate1 = "29" Then XDate1 = "28"
If XDate2 = "02" And XDate1 = "30" Then XDate1 = "28"
HijraDate = XDate1 + "/" + XDate2 + "/" + Trim(XDate3)

End Function
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:01 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC