Paul Eggert wrote:
> > For Iran, there is an authoritative source (some institute at the
> > university of Teheran), cited by the wikipedia page [4] that gives the
> > complete list of leap years for the time period that we are interested
> > in (1925 to 2100).
> 
> That list of years says it was compiled by Hujjat al-Islam Mehdi 
> Sohrabi, a cleric in the University of Tehran. Although that's a 
> reasonable source I wouldn't call it authoritative, and there are other 
> good sources.
> 
> Part of the problem is that the 1925 Iranian law, still in force, does 
> not specify which location is used for solar noon vs the vernal equinox, 
> and various sources use Tehran, Isfahan, and standard time (3.5 hours 
> ahead of UTC). Although I guess Sohrabi used Tehran, his list doesn't 
> say, which is a bit slipshod. When push comes to shove (e.g., in the 
> year 2091 assuming the law doesn't change before then) nobody knows what 
> Iran will do about these glitches in practice.

That was the situation from 1925 (section "History" of [4]).

Meanwhile, the situation in 2025 (sections "The moment of delivery of the year"
and "Leap year in the official calendar of Iran") is that the "Calendar Center
of the Geophysics Institute of the University of Tehran" has made up the list
of the leap years until 1498, i.e. 2120 A.D. The calculations were made by
Iraj Malekpour [5], who 1. is the head of that institute and 2. has written
"a 19-volume book collection on the 5,000-year-old Iranian calendar".
I don't think you can get anything more official than that.

> > what matters is the actual use in Iran,
> > not some astronomical calculation.
> 
> Is your point that the current Iranian calendar is astronomical, not 
> calculated? That is, that it's based on astronomical observations, not 
> astronomical calculations?

A calendar that is based on astronomical observations, without calculations,
could only apply to the past, not to the future. That's not what I mean.

What I mean is: when there is discrepancy between code by Edward M. Reingold,
who co-authored a book "Calendrical Calculations" but lives in the U.S. [6],
on one hand and the director of the "Calendar Center" of Iran, who is
being cited as the best expert on Iran's calendar [4], on the other hand,
my trust goes to the Iranian guy.

> If so, I agree. But this means that for 
> "actual use in Iran" one cannot in general calculate dates far in the 
> future, as any such calculations will be wrong in some cases. Similarly 
> for dates far in the past.

Absolutely. That's why, in each of the 3 calendar files that I implemented,
I added limits. So that the 'date' program falls back on the Gregorian
calendar outside these limits:

$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d now
1404-04-25
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 101 years'
1924-07-16
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now + 100 years'
2125-07-16

> Also, "actual use in Iran" has differed over the years. From 1976 to 
> 1978 Iran officially used an imperial calendar, not the Solar Hijri 
> calendar. The Gnulib code doesn't implement this

It does, in the sense that it uses the fallback calendar for these years:

$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 51 years'
1353-04-25
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 50 years'
1975-07-16
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 49 years'
1976-07-16
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 48 years'
1977-07-16
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 47 years'
1978-07-16
$ LC_ALL=fa_IR src/date +'%Y-%m-%d' -d 'now - 46 years'
1358-04-25

I don't think it would be very useful to add significant code for this
period from 1976 to 1978, nearly 50 years in the past.

> If you've tested the code

I tested it 1. by comparing to what ICU produces and 2. against information
from Wikipedia. But only in the limited range from 1925 to 2100, not
centuries ago or ahead.

> Perhaps we should change strftime to fail with EOVERFLOW if asked to 
> convert dates outside the 1925-2091 range? Similarly for the Thai calendar.

strftime is supposed to produce a string. That's why I used a string
fallback.

Bruno

[4] 
https://fa-m-wikipedia-org.translate.goog/wiki/%DA%AF%D8%A7%D9%87%E2%80%8C%D8%B4%D9%85%D8%A7%D8%B1%DB%8C_%D8%B1%D8%B3%D9%85%DB%8C_%D8%A7%DB%8C%D8%B1%D8%A7%D9%86?_x_tr_sl=fa&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp
[5] 
https://fa-m-wikipedia-org.translate.goog/wiki/%D8%A7%DB%8C%D8%B1%D8%AC_%D9%85%D9%84%DA%A9%E2%80%8C%D9%BE%D9%88%D8%B1?_x_tr_sl=fa&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp&_x_tr_hist=true
[6] https://en.wikipedia.org/wiki/Edward_Reingold




Reply via email to