We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


arabic/islamic date in javascript

lufupa asked
Medium Priority
Last Modified: 2010-08-05
I am looking for a javascript that displays the date in
Arabic/Islamic terms. This would require converting the
Georgian dates to the equivilant Arabic/Islamic date.
Watch Question

what does that look like?



if you look at this website, it will give you more info.
the site has a cgi based converter for arabic dates. i am not
able to use that & so i am looking for a javascript based version.



if you look at this website, it will give you more info.
the site has a cgi based converter for arabic dates. i am not
able to use that & so i am looking for a javascript based version.


I'm not going to answer because I have absolutely no idea what kind of conversion factors you need to use or how similar a format arabic and gregorian dates are. ( yes, I'm from north america ) anyway...You can use the getTime() function on your page, and it will return the number of seconds since January 1, 1997.  You could then write the code to convert and display that date in Arabic form.  That's my 2 cents... it might help...

I also beleive that if you are asking for someone to write all the code required for you, you will have to supply WAY MORE information on how to convert that data.  ( I seriously doubt that any expert on this site wants to write this code for you for points...it would be more like dollars.
I hope you get the answer you're looking for.

By the way...the page format looks fantastic.  Very clean and professional.


Excuse me....I made a typo....

I said
"number of seconds since January 1, 1997"

that's obviously wrong..... It should be:

"number of seconds since January 1, 1970"

Lufupa, if you will follow further, you will find
authors of this CGI converter. Do not stop, follow his page
and you will find download of his program.
This package include C source.
Well, last step, if you have enough programming skills
you can rewrite conversion algorithm.
Otherwise you can ask somebody to do this work for you.

If you wanted to use a different language--then my advice to
you was obtain the appropiate font for that language and
apply it to your browser....
I'm not sure how such a calendar could work seeing as how
the Islamic year is unpredictable. By that I mean that
Ramadan starts and stops according to the sighting of
the moon by 3 reliable witnesses. Since we don't know when
the moon will be sited how can we make a future calendar.
Now if you are talking about the past, then we must know
when the moon was sighted on each of the lunar years.
  But Assuming that you consider this a trivial point,
It seem to me that you could use any one of the astrological
tools available to find the formula. These usually involve
the use of a book called and Ephemiris. (check my spelling
here) So, go to any astrologer and ask how to calculate
x number of moons ago.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

PS. If we can find a method to do the conversion, I might
like to try writing the JavaScript which does it.



Thanks to all who responded to this question. In my the view the
question still remain unanswered. It seems the only it will work
is by the cgi program written by the person whose link i provided
in my previous comments

How do you know that the cgi is correct? Have you actually
confirmed any dates? And if so, for how far back? I would
not be surprised if the cgi is not very accurate.
I'd still like to persue but it may take a while.
There is a email list called History of Islam where there
are very learned scholars who may be able to answer
questions about the calender. I will ask there. I have set
up a temporary address where you can contact me if you
are interested in continuing this. latif@kirin.tymnet.com
Thanks for the points. :-)



I am still very much interested in finding out a solution for
this script & have made a note of your email. I will email the person who wrote the cgi for information and i will email you with the reply. Thanking you for you help and advice



here is the link to explain of the Islamic Calendar. Maybe it will give you some idea how to convert.

Regards Ades
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.