The HijriCal API is a RESTful API that can be accessed in any programming language.

  • The main API URL is:

http://www.your-domain.com/Convert.aspx

  • The parameters to be used are:
Parameter Description
type This parameter identifies the type of conversion (Hijri-to-Gregorian) or (Gregorian-to-Hijri). The possible values are h2g or g2h
auth The authorization code
day Day (1-31)
month Month (1-12)
year Year (1 and up)

Please note that you need to fill in ALL parameters or else you will get a "Parameter Error".

Example:

http://www.your-domain.com/Convert.aspx?type=g2h&auth=TEST&day=10&month=11&year=2012

  • Output:

The format of the output is DDMMYYYYDayOfWeek

Two characters representing the Day, two characters representing the Month, four characters representing the year, and the rest of the string is the day of the week.

Example:

The output of the previous example request is

25121433Saturday

Which means 25-12-1433, Saturday.

Calendar.aspx
I added another part to it to help in creating monthly Calendars.In this second file you send the Hijri month number and year, and t would give you back the Gregorian date of the first day of that Hijri month (with the week day) and the Gregorian date of the first day in the next Hijri month so that you would know if this Hijri month is 29 or 30 days.
It works like this:
  • The main API URL is:

http://www.your-domain.com/Calendar.aspx

  • The parameters to be used are:
Parameter Description
 month Month (1-12)
auth The authorization code
year Year (1 and up)

Please note that you need to fill in ALL parameters or else you will get a "Parameter Error".

Example:

http://www.your-domain.com/Calendar.aspx?auth=TEST&month=1&year=1434

  • Output:

The format of the output is DDMMYYYYDayOfWeek

Two characters representing the Day, two characters representing the Month, four characters representing the year, and the rest of the string is the day of the week. Then a "-" separator between the first date and the second date which is the Gregorian date of the first day of the next Hijri month.

Example:

The output of the previous example request is

15112012Thursday-14122012Friday

Which means 15-11-2012, Thursday and 14-12-2012, Frieday.

Last edited Nov 21, 2012 at 1:07 PM by DrAlani, version 2

Comments

No comments yet.