I did some more research on the accuracy of different leap year algorithms. My conclusion is that unless there is an implementation of an astronomical algorithm, we SHALL use the 33 year period, as it gives the best estimates for near future and near past. That is, use the following: bool isLeapYear = ((y*8+29)%33) < 8;
I used the following table of vernal equinox times for years 1788-2011: http://www.newscotland1398.net/equinox/vern1788.html I computed the length of year for each year. and unfortunately, I could not find any simple curve to fit the length of years. Assuming that the real vernal equinox does not differ from the table above by more than +/- 10 minutes, and that the noon will be at 12:04:20, I am convinced that this formula is correct at a minimum from 1178 to 1468. At the same time, the Birashk's method and hence Omid K. Rad's implementation are only correct from 1244 to 1402. Another way to interpret this email is that Birashk's method fails to correctly predict the year 1403, and hence if we use that mehtod, all dates in year 1404 will be off by one day. On the other hand, using the 33 year period mentioned above works fine until year 1468. So, for all applications that need to convert near-term dates, my recommendation is to use a 33-year implemntation, like the one found at http://www.farsiweb.info or the one at http://www.payvand.com/calendar/. -- ODC _______________________________________________ PersianComputing mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/persiancomputing