Installation

Gregorian to Hijri Date Converter

What is a DLL?

A dynamic link library (DLL) is a library that contains code and data that can be used by more than one program at the same time.


Installation Steps


1. In Solution Explorer, right-click on the root directory then click Add and then click Reference.. to open Reference Manager dialog box.

2. Browse GregorianHijriDate.dll file

Cinque Terre

3. Use the following procedure to call the properties of your GregorianHijriDate.dll file in your application.

4. Add a namespace in the codebehind file (C# CodeBehind)

using GregorianHijriDate;

5. Create an Object of the "GH" class, as in the following:

GH gh = new GH();

Now you can call the properties as mentioned below


Methods


Summary

Returns culture information of the server operating system.

Syntax

gh.GetCultureInfo().ToString()

Example

Response.Write(gh.GetCultureInfo());

Output

The output will be based on the computer's current culture info (ar-SA, en-US)

Summary

Returns arabic calendar name.

Syntax

gh.GetArabicCalendarName()

Example

Response.Write(gh.GetArabicCalendarName());

Summary

Returns current time

Syntax

gh.GetCurrentTime()

Example

Response.Write(gh.GetCurrentTime());

Summary

Returns an indication whether the specified hijri year is a leap year.

Syntax

gh.IsHijriLeapYear(Int32 HijriYear)

Example

Response.Write(gh.IsHijriLeapYear(1440))

Output

Returns a bool value, True

Summary

Returns an indication whether the specified gregorian year is a leap year.

Syntax

gh.IsGregorianLeapYear(Int32 GregorianYear)

Example

Response.Write(gh.IsGregorianLeapYear(2016));

Output

Returns a bool value, True

Summary

Returns days in a hijri month.

Syntax

gh.GetDayInHijriMonth(Int32 HijriYear, Int32 HijriMonth)

Example

Response.Write(gh.GetDayInHijriMonth(1438, 01));

Output

Returns a value, 30

Summary

Returns days in a gregorian month.

Syntax

gh.GetDayInGregorianMonth(Int32 GregorianYear, Int32 GregorianMonth)

Example

Response.Write(gh.GetDayInGregorianMonth(2016, 10));

Output

Returns a value, 31

Summary

Returns minimum gregorian date.

Syntax

gh.GetMinGregorianDate()

Example

Response.Write(gh.GetMinGregorianDate());

Output

Returns minimum date supported by the gregorian calendar, 1900/04/30

Summary

Returns maximum gregorian date.

Syntax

gh.GetMaxGregorianDate()

Example

Response.Write(gh.GetMaxGregorianDate());

Output

Returns maximum date supported by the gregorian calendar, 2077/11/16

Summary

Returns minimum hijri date.

Syntax

gh.GetMinHijriDate()

Example

Response.Write(gh.GetMinHijriDate());

Output

Returns minimum date supported by the UmAlQura calendar, 1318/01/01

Summary

Returns maximum hijri date.

Syntax

gh.GetMaxHijriDate()

Example

Response.Write(gh.GetMaxHijriDate());

Output

Returns maximum date supported by the UmAlQura calendar, 1450/12/29

Summary

Returns gregorian day of the week.

Syntax

gh.GetGregorianWeekDay(string GregorianDate)

Example

1. Response.Write(gh.GetGregorianWeekDay("27/10/2016"));

2. Response.Write(gh.GetGregorianWeekDay(System.DateTime.Now.ToString("dd/MM/yyyy")));

Summary

Returns hijri day of the week.

Syntax

gh.GetHijriWeekDay(string HijriDate)

Example

Response.Write(gh.GetHijriWeekDay(System.DateTime.Now.ToString("dd/MM/yyyy")));

Summary

Returns numbers converted from english to arabic.

Syntax

gh.ConvertNumerals(string Input)

Example

Response.Write(gh.ConvertNumerals("0123456789"));

Output

٠١٢٣٤٥٦٧٨٩

Summary

Returns an indication whether the specified date is hijri date.

Syntax

gh.IsHijri(string HijriDate)

Example

1. Response.Write(gh.IsHijri("03/01/1438"));

 

Output: True

 

2. Response.Write(gh.IsHijri("29/01/2016"));

 

Output: False

Summary

Returns an indication whether the specified date is gregorian date.

Syntax

gh.IsGregorian(string GregorianDate)

Example

1. Response.Write(gh.IsGregorian("04/10/2016"));

 

Output: True

 

2. Response.Write(gh.IsGregorian("25/03/1438"));

 

Output: False

Summary

Returns formatted hijri date.

Syntax

gh.FormatHijri(string HijriDate, string Format)

Example

1. Response.Write(gh.FormatHijri("29/03/1438", "MM/yyyy/dd"));

 

Output: 03/1438/29

 

2. Response.Write(gh.FormatHijri("29/03/1438", "dd/yyyy/MM"));

 

Output: 29/1438/03
 

3. Response.Write(gh.FormatHijri("29/03/1438", "yyyy/MM/dd"));

 

Output: 1438/03/29

 

4. Response.Write(gh.FormatHijri("29/03/1438", "MM/dd/yyyy"));

 

Output: 03/29/1438

Summary

Returns formatted gregorian date.

Syntax

gh.FormatGregorian(string GregorianDate, string Format)

Example

1. Response.Write(gh.FormatGregorian("24/09/2016", "MM/yyyy/dd"));

 

Output: 09/2016/24

 

2. Response.Write(gh.FormatGregorian("24/09/2016", "dd/yyyy/MM"));

 

Output: 24/2016/09
 

3. Response.Write(gh.FormatGregorian("24/09/2016", "yyyy/MM/dd"));

 

Output: 2016/09/24

 

4. Response.Write(gh.FormatGregorian("24/09/2016", "MM/dd/yyyy"));

 

Output: 09/24/2016

Summary

Returns current gregorian date.

Syntax

gh.GregorianDateNow()

Example

1. Response.Write(gh.GregorianDateNow());

2. Response.Write(gh.GregorianDateNow("MM/dd/yyyy"));

Summary

Returns current hijri date.

Syntax

gh.HijriDateNow()

Example

1. Response.Write(gh.HijriDateNow());

2. Response.Write(gh.HijriDateNow("MM/dd/yyyy"));

Summary

Returns gregorian month name for the specified month (Eg: Returns 1 for January, 2 for February, ... 12 for December).

Syntax

gh.GetGregorianMonth(string GregorianMonth)

Example

Response.Write(gh.GetGregorianMonth("3"));

Output

March

Summary

Returns hijri month name for the specified month (Eg: Returns 1 for Muharram, 2 for Safar, ... 12 for Zulhijjah).

Syntax

gh.GetHijriMonth(string HijriMonth)

Example

Response.Write(gh.GetHijriMonth("1"));

Output

Muharram

Summary

Returns hijri day of the week.

Syntax

GetHijriDay(string GregorianDayOfWeek)

Example

Response.Write(gh.GetHijriDay("Tuesday"));

Output

الثلاثاء

Summary

Returns hijri date to gregorian date.

Syntax

gh.HijriToGregorian(string HijriDate)

Example

Response.Write(gh.HijriToGregorian("21/01/1438"));

Output

2016/10/22

Summary

Returns gregorian date to hijri date.

Syntax

gh.GregorianToHijri(string GregorianDate)

Example

Response.Write(gh.GregorianToHijri("25/10/2016"));

Output

1438/01/24

Summary

Returns gregrian date time as digit stamp.

Syntax

gh.GregorianTimeStamp()

Example

Response.Write(gh.GregorianTimeStamp());

Output

20161012214320

Summary

Returns hijri date time as digit stamp.

Syntax

gh.HijriTimeStamp()

Example

Response.Write(gh.HijriTimeStamp());

Output

14380111214437