iDateInYear

Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >

iDateInYear

Previous pageReturn to chapter overviewNext page

int = iDate1InYear(anIslDay, anIslMonth, nYear)

int = iDate2InYear(anIslDay, anIslMonth, nYear)

 

These macro functions return the first and, eventually, second date on which a Islamic date occurs for the regular year nYear.

 

For example, to calculate the beginning of Ramadan in 2005 :

 

 nStartRamadan = iDate1InYear(1, 1, 2005)

 

Note that the above will be calculated using the Muslim Calendar specified in the current script's Muslim Data property. It is therefore possible that the result of this function be different from one script to the next, if these 2 scripts use different Muslim calendars.

 

Note also that there are 2 functions because the Islamic calendar is not exactly aligned with the Gregorian, Western, calendar and therefore a given Islamic date may occur more than once in a Gregorian year. To determine if a given Islamic day-month pair occurs more than once in a year, you need to see if the value of iDate2InYear() is larger than 0.

 

 bTwoOccurences = (iDate2InYear(anIslDay, anIslMonth, aYear) > 0)

 

The issue of multiple occurences of a date in a given year is much more important for the Islamic calendar than for other calendars which do not exactly match the Gregorian year. While calendars such as the Chinese or Jewish calendars do not match the Gregorian year exactly, on average because of their leap month structure, their dates are somewhat related to Gregorian dates (for example, the Chinese New Year always occurs between January 20 and February 10), and most dates you need to calculate (holidays) do not occur near the beginning of January. But the Islamic Calendar is on average always 11 days shorter than the Gregorian year, as can be seen from the date of the start of the Muslim year over 5 years :

 

Year

Year Start

1421

06-apr-2000

1422

26-mar-2001

1423

15-mar-2002

1424

04-mar-2003

1425

22-feb-2004

 

This means that Islamic dates "slip" from one year to the other with respect to the Gregorian calendar, and that any holday date may eventually occur twice in the same Gregorian year (for example Eid al F'tir occured twice in 2000).


Topic 161100 updated on 03-Jul-2003.
Topic URL: http://www.qppstudio.net/webhelp/index.html?idateinyear.htm