first of all in vb Access i can convert the date formate as i want . but in .NET
How to Convert a Gregorian date to Hijri format
thanks for all
Printable View
first of all in vb Access i can convert the date formate as i want . but in .NET
How to Convert a Gregorian date to Hijri format
thanks for all
In Access 2002, there is an option to use Hijri Calendar, you can find it in tools, options, international.
First:
I am sorry for previous response, I thought you said you CANT use Hijri calendar in access
Then:
use the following code to change from georgian date to Hijri
Code:Dim hj As New CultureInfo("ar-SA")
Dim hjyr, hjmo, hjday As Integer, gdate As DateTime
gdate = #11/11/2002# 'or any other date
hj.DateTimeFormat.Calendar = New HijriCalendar()
hjyr = hj.DateTimeFormat.Calendar.GetYear(gdate)
hjmo = hj.DateTimeFormat.Calendar.GetMonth(gdate)
hjday = hj.DateTimeFormat.Calendar.GetDayOfMonth(gdate)