Arun Arun - 3 months ago 25
Javascript Question

how to convert hijari date into gregorian date in java script?

i am use intalio editer in that i want to convert hijari date into gregorian date or vice-versa. we write code in java script using jsx3 so please help me.

Answer

It helps to know that muslims refer to the Gregorian calendar as Masihi. Googling for "hijrah to masihi converter" turns up this page as the second hit: http://www.islamicity.com/PrayerTimes/defaultHijriConv.asp

The javascript is code contains two functions GregToIsl and IslToGreg that does what you want.

There is a copyright notice on that page so you shouldn't simply copy-paste the code. But the functions are short enough for you to extract the relevant maths out of.

The maths/algorithm itself is almost a thousand years old so it shouldn't have any legal restriction.

Comments