•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 423,509 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,686 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1802 | Replies: 4
![]() |
•
•
Join Date: Aug 2007
Posts: 40
Reputation:
Rep Power: 2
Solved Threads: 0
Greetings!
Anybody know how to set or get the value of hijri calendar. Like for example I set the date in the form of mm/dd/yyyy gregorian calendar the value is 12/22/2007. I want to get the equivalend value in hijri calendar which is 12/12/1428. Then If i set the date again in other value like 10/10/2007 the hijri date value also change in equivalent value.
The main purpose of mine is to set the gregorian date and get the equivalent hijri date or the arabic date.
Thank you in advance.
Anybody know how to set or get the value of hijri calendar. Like for example I set the date in the form of mm/dd/yyyy gregorian calendar the value is 12/22/2007. I want to get the equivalend value in hijri calendar which is 12/12/1428. Then If i set the date again in other value like 10/10/2007 the hijri date value also change in equivalent value.
The main purpose of mine is to set the gregorian date and get the equivalent hijri date or the arabic date.
Thank you in advance.
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello friend.. this is an VB5-6 code to convert Gregorian calendar to Hijri Calendar.. Enjoy
from SoulSoft@mailmeasap.com .
from SoulSoft@mailmeasap.com .
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Playing .Wav/MIDI files in a Visual Basic Program (Visual Basic 4 / 5 / 6)
- Creating an OS in visual basic 6.0 (Visual Basic 4 / 5 / 6)
- The Move.....Visual Basic 6, Visual Basic .NET ? (VB.NET)
- Encrypting a Visual Basic application (Visual Basic 4 / 5 / 6)
- passing arrays in visual basic (Visual Basic 4 / 5 / 6)
- Visual Basic.net (VB.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: olisan
- Next Thread: Cannot use SELECT queries in VB Excel?


Linear Mode