Syntax for calculation methods for times

The calculation method is a mathematical expression.
The mathematical signs +, -, *, /, ( and ) can be used.

The calculation is performed in minutes, and the time is counted from midnight on.
The variables sunrise and sunset represent the moment of sunrise respective sunset.

The length of a proportional hour is obtained by subtracting the time of sunset from the time of sunrise and dividing it by 12.
So the day is divided into 12 proportional hours, and the beginning of a proportional hour can be obtained by the function proportional_hour which takes the number of the proportional hour and returns the time when it occurs (relative to sunrise).
For example, if an event occurs 5 proportional hours after sunrise, the expression would be:

    sunrise + proportional_hour(5)

The function degrees_below_horizon takes the declination angle, in degrees, of the sun below the horizon and returns the length of dawn respective twilight.
This function should be used in conjunction with the variables sunrise (if the event takes place in the morning) and sunset (if the event takes place in the evening).
For example, if an event takes place 9.5 degrees below the horizon in the morning, the expression would be:

    sunrise - degrees_below_horizon(9.5)

and when it takes place in the evening, it would be:

    sunset + degrees_below_horizon(9.5)

The predefined Zmanim in the default ZMANIM.TXT file

In brackets [ and ], the name of the Zmanim in the default ZMANIM.TXT file is enclosed which can be specified in the lpTimeInFile member of the JEWCALTIME structure.

(phr = proportional hour)

Candle Lighting [CandleLighting]:
sunset - 18 minutes

End of shabbat:
sunset + 45 minutes [EndOfShabbat45]
8 degrees below horizon [EndOfShabbat8]

Alot HaShachar (dawn):
16.1 degrees below horizon [AlotHaShachar161]
72 minutes before sunrise [AlotHaShachar72]
90 minutes before sunrise [AlotHaShachar90]
72 proportional minutes before sunrise [AlotHaShacharProp72]

Earliest Tallit:
11 degrees below horizon [EarliestTallit11]
10.2 degrees below horizon [EarliestTallit102]

HaNetz HaChama = sunrise [HaNetzHaChama]

Kriat Shema:
M"A = sunrise + 3 phr - 36 minutes [KriatShemaMA]
GR"O = sunrise + 3 phr [KriatShemaGRO]

M"A = sunrise + 4 phr - 24 minutes [TefilaMA]
GR"O = sunrise + 4 phr [TefilaGRO]

GR"O = sunrise + 6 phr [ChatzotGRO]
M"A = sunrise + 6 phr [ChatzotMA]

Mincha Gedola:
GR"O = sunrise + 6.5 phr [MinchaGedolaGRO]
M"A = sunrise + 6.5 phr + 6 minutes [MinchaGedolaMA]

Mincha K'tana:
GR"O = sunrise + 9.5 phr [MinchaKtanaGRO]
M"A = sunrise + 9.5 phr + 42 minutes [MinchaKtanaMA]

Plag HaMincha:
GR"O = sunrise + 10.75 phr [PlagHaMinchaGRO]
M"A = sunrise + 10.75 phr + 57 minutes [PlagHaMinchaMA]

Shkia = sunset [ShkiaHaChama]

Tzait HaCochavim:5.95 degrees below horizon[TzaitHakochavim]
3 Medium Stars:7.5 degrees below horizon[ThreeMediumStars]
3 Small Stars:8.75 degrees below horizon[ThreeSmallStars]
Rabbeinu Tam:sunset + 72 minutes[RabbeinuTam]

Sha'a Zmanit = (sunset - sunrise) / 12 [ShaaZmanit]

Accuracy of the shabbat times and Zmanim calculation

The program uses a mathematical algorithm to calculate the times for sunrise, sunset and Zmanim (depends on the date and location, that means latitude, longitude and time zone), whose accuracy is 1 to 2 minutes on the average.

Times which cannot be calculated

Some astronomical events sometimes cannot occur because the sun cannot reach larger declination angles (degrees below horizon) at some location.
If a time could not be calculated because of this, the error code JEWCAL_ERROR_NO_ASTRONOMICAL_EVENT is returned.
This mostly occurs at dawn, if large declination angles have to be calculated, e.g. with Alot Hashachar with 16.1 degrees below horizon - for this Zmanim, an alternative is offered (72 minutes before sunrise), which can be also changed individually.