20 Oct 2005 roozbeh   » (Master)

i18n: Microsoft has now finally implemented a PersianCalendar class in .NET (MSDN documentation, Michael Kaplan's blog).

The algorithm is the simple 33-year leap rule, which will fail to match the official Iranian calendar around 2089 CE.

But well, it's my own fault: it is the description I provided to Microsoft's Houman Pournasseh in 2001, IIRC, with some test data (the sentence "A leap year is a year that, when divided by 33, has a remainder of 1, 5, 9, 13, 17, 22, 26, or 30." in MSDN looks very much to be my own words). At that time, I thought that was the correct rule.

There is also a 2820-year rule suggestion circling in various "patriotic" circles, which is 1) more complex than the 33-year rule; and 2) fails in about 2025 CE, in my own lifetime. For a while, I and Behdad were fooled into believing that this 2820-year rule is the official rule. It was only luck that Houman has asked me about the rule earlier than that. (We don't need that kind of luck in free software much, but that's another story.)

The official rule, implemented in a 1925 law, says that the beginning of the year is the first day of spring, that the year is the "true solar" year "as it has been". This means that one needs to do astronomical predictions of the time of vernal equinox and the true solar noon in order to compute the calendar properly. I am happy that the current predictions match the 33-year rule until about 2089, by when I will definitely be dead (if the law is not changed or something), and people won't be able to blame me for an incorrect implementation. (Well, my children may not like people blaming me for a Persian Y2K, but I guess I should not worry that much.)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!