I am developing an application which allows users to convert from Gregorian to Hijri dates and vice-versa. I am thinking about whether to just have an input box for the date (e.g. 8/21/2021), or to have an additional input box for the time (e.g. 6:00 AM), as I have heard from others that a new day in the Hijri calendar can start in the same day in the Gregorian calendar? Furthermore, does the Islamic Hijri calendar run on a standard 24-hour day just like the Gregorian calendar?
Each day in the Hijri calendar traditionally starts at sunset, not midnight as in the Gregorian calendar, so each Hijri day would actually span two Gregorian days sunset to sunset.
In addition, months start and end according to the hilal (the first crescent moon after a new moon). There are three major methods for determining this, which means different countries may start the month a day earlier or later than others depending on which method they follow:
- Local hilal, where the month begins and ends as soon as the hilal is sighted within the region.
- Global hilal, where the month begins and ends as soon as the hilal is sighted anywhere in the world.
- Astronomical hilal, where astronomical projections can be used to calculate when the hilal would be visible, regardless of actual sighting.
Many countries choose to synchronize their own calendars with the calendars used in Saudi Arabia (i.e. Mecca); this is often for religious reasons, to ensure that Islamic festivals are all celebrated on the same day.
In practice, most calendars I see map the Hijri date to the following day on the Gregorian calendar, so e.g. if the 14th of Muharram starts at sunset on August 21 until sunset on August 22, the calendar would map it to August 22. However, I do not know how consistent this is in different regions.