Log in

View Full Version : Change Date To Ghamary



lol33d
04-07-2008, 05:00 PM
hi all

How can change date to [ HIJRI GHAMARY ] OR [ GHAMARI ] with php?:confused:


Help Me

benslayton
04-12-2008, 06:02 AM
What?

tonyking
04-14-2008, 09:49 PM
If I am understanding his/her request correctly... they basically want a conversion to a lunar calendar, as this is what most of the Arabic countries use.

In order to do so, a basic calculation would need to be performed to calculate the lunar calendar day, based on our standard calendar (Julian Year - 365.25 days). A lunar year is 354.75 days, so all you really need to do is pick a reference point and let the numbers so the rest!

total days / days of year = # of years, with a remainder of days
would work accurately.

The months of a lunar calendar is what I don't know. If you can provide/post a list of the months, for a normal year and a leap year, I could put you a little script together that would change the dates back and forth.

djr33
04-14-2008, 10:11 PM
That's difficult. The Hijri calendar is not calculated in a numerical way, but rather based on lunar and other events which, though possible to calculate, are, as far as I know, based more on observation than prediction. Seeing the moon in Egypt is, for example, how a month may start or end. I don't know the details, though. Considering, I guess that a numerical approximation won't be entirely accurate in some sense.

Here's something that may help: http://www.phpclasses.org/browse/package/3850.html

Google has a LOT of results. It might take some time to find something you like, but I'm sure you can find something if you look hard enough.