diff --git a/KosherSwift/ComplexZmanimCalendar.swift b/KosherSwift/ComplexZmanimCalendar.swift index 9900f15..9bded9c 100644 --- a/KosherSwift/ComplexZmanimCalendar.swift +++ b/KosherSwift/ComplexZmanimCalendar.swift @@ -6,3 +6,4513 @@ // import Foundation + +/** + *
This class extends ZmanimCalendar and provides many more zmanim than available in the ZmanimCalendar. The basis + * for most zmanim in this class are from the sefer Yisroel + * Vehazmanim by Rabbi Yisrael Dovid Harfenes. + * As an example of the number of different zmanim made available by this class, there are methods to return 18 + * different calculations for alos (dawn), 18 for plag hamincha and 29 for tzais available in this + * API. The real power of this API is the ease in calculating zmanim that are not part of the library. The methods for + * zmanim calculations not present in this class or it's superclass {@link ZmanimCalendar} are contained in the + * {@link AstronomicalCalendar}, the base class of the calendars in our API since they are generic methods for calculating + * time based on degrees or time before or after {@link #getSunrise sunrise} and {@link #getSunset sunset} and are of interest + * for calculation beyond zmanim calculations. Here are some examples. + *
First create the Calendar for the location you would like to calculate: + * + *
+ * String locationName = "Lakewood, NJ"; + * double latitude = 40.0828; // Lakewood, NJ + * double longitude = -74.222; // Lakewood, NJ + * double elevation = 20; // optional elevation correction in Meters + * // the String parameter in getTimeZone() has to be a valid timezone listed in + * // {@link java.util.TimeZone#getAvailableIDs()} + * TimeZone timeZone = TimeZone.getTimeZone("America/New_York"); + * GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); + * ComplexZmanimCalendar czc = new ComplexZmanimCalendar(location); + * // Optionally set the date or it will default to today's date + * czc.getCalendar().set(Calendar.MONTH, Calendar.FEBRUARY); + * czc.getCalendar().set(Calendar.DAY_OF_MONTH, 8);+ *
+ * Note: For locations such as Israel where the beginning and end of daylight savings time can fluctuate from
+ * year to year, if your version of Java does not have an up to date timezone database, create a
+ * {@link java.util.SimpleTimeZone} with the known start and end of DST.
+ * To get alos calculated as 14° below the horizon (as calculated in the calendars published in Montreal),
+ * add {@link AstronomicalCalendar#GEOMETRIC_ZENITH} (90) to the 14° offset to get the desired time:
+ *
+ *
+ * Date alos14 = czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 14);+ *
+ * To get mincha gedola calculated based on the Magen Avraham (MGA) using a shaah zmanis based on the day starting + * 16.1° below the horizon (and ending 16.1° after sunset) the following calculation can be used: + * + *
+ * Date minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees() * 6.5);+ *
+ * or even simpler using the included convenience methods + *
+ * Date minchaGedola = czc.getMinchaGedola(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees());+ *
+ * A little more complex example would be calculating zmanim that rely on a shaah zmanis that is
+ * not present in this library. While a drop more complex, it is still rather easy. An example would be to calculate
+ * the Trumas Hadeshen's alos to
+ * tzais based plag hamincha as calculated in the Machzikei Hadass calendar in Manchester, England.
+ * A number of this calendar's zmanim are calculated based on a day starting at alos of 12° before
+ * sunrise and ending at tzais of 7.083° after sunset. Be aware that since the alos and tzais
+ * do not use identical degree-based offsets, this leads to chatzos being at a time other than the
+ * {@link #getSunTransit() solar transit} (solar midday). To calculate this zman, use the following steps. Note
+ * that plag hamincha is 10.75 hours after the start of the day, and the following steps are all that it takes.
+ *
+ *
+ * Date plag = czc.getPlagHamincha(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12), + * czc.getSunsetOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + ZENITH_7_POINT_083));+ *
+ * Something a drop more challenging, but still simple, would be calculating a zman using the same "complex" + * offset day used in the above mentioned Manchester calendar, but for a shaos zmaniyos based zman not + * supported by this library, such as calculating the point that one should be makpid + * not to eat on erev Shabbos or erev Yom Tov. This is 9 shaos zmaniyos into the day. + *
+ * long shaahZmanis = czc.getTemporalHour(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12), + * czc.getSunsetOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + ZENITH_7_POINT_083)); + * Date sofZmanAchila = getTimeOffset(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12), + * shaahZmanis * 9);+ *
+ * Calculating this sof zman achila according to the GRA + * is simplicity itself. + *
+ * Date sofZamnAchila = czc.getTimeOffset(czc.getSunrise(), czc.getShaahZmanisGra() * 9);+ * + *
long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getShaahZmanis19Point8Degrees() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos19Point8Degrees(), endOfDay: getTzais19Point8Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a 18° dip. This calculation divides
+ * the day based on the opinion of the Magen Avraham
+ * (MGA) that the day runs from dawn to dusk. Dawn for this calculation is when the sun is 18° below the
+ * eastern geometric horizon before sunrise. Dusk for this is when the sun is 18° below the western geometric
+ * horizon after sunset. This day is split into 12 equal parts with each part being a shaah zmanis.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getShaahZmanis18Degrees() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos18Degrees(), endOfDay: getTzais18Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a dip of 26°. This calculation
+ * divides the day based on the opinion of the Magen
+ * Avraham (MGA) that the day runs from dawn to dusk. Dawn for this calculation is when the sun is
+ * {@link #getAlos26Degrees() 26°} below the eastern geometric horizon before sunrise. Dusk for this is when
+ * the sun is {@link #getTzais26Degrees() 26°} below the western geometric horizon after sunset. This day is
+ * split into 12 equal parts with each part being a shaah zmanis. Since zmanim that use this
+ * method are extremely late or early and at a point when the sky is a long time past the 18° point where the
+ * darkest point is reached, zmanim that use this should only be used lechumra, such as
+ * delaying the start of nighttime mitzvos.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis120Minutes()
+ */
+ public func getShaahZmanis26Degrees() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos26Degrees(), endOfDay: getTzais26Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a dip of 16.1°. This calculation
+ * divides the day based on the opinion that the day runs from dawn to dusk. Dawn for this calculation is when the
+ * sun is 16.1° below the eastern geometric horizon before sunrise and dusk is when the sun is 16.1° below
+ * the western geometric horizon after sunset. This day is split into 12 equal parts with each part being a
+ * shaah zmanis.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos16Point1Degrees()
+ * @see #getTzais16Point1Degrees()
+ * @see #getSofZmanShmaMGA16Point1Degrees()
+ * @see #getSofZmanTfilaMGA16Point1Degrees()
+ * @see #getMinchaGedola16Point1Degrees()
+ * @see #getMinchaKetana16Point1Degrees()
+ * @see #getPlagHamincha16Point1Degrees()
+ */
+
+ public func getShaahZmanis16Point1Degrees() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (solar hour) according to the opinion of the Magen Avraham (MGA). This calculation
+ * divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is
+ * 60 minutes before sunrise and dusk is 60 minutes after sunset. This day is split into 12 equal parts with each
+ * part being a shaah zmanis. Alternate methods of calculating a shaah zmanis are available in the
+ * subclass {@link ComplexZmanimCalendar}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos60()
+ * @see #getTzais60()
+ * @see #getPlagHamincha60Minutes()
+ */
+ public func getShaahZmanis60Minutes() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos60(), endOfDay: getTzais60());
+ }
+
+ /**
+ * Method to return a shaah zmanis (solar hour) according to the opinion of the Magen Avraham (MGA). This calculation divides the day
+ * based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 72 minutes
+ * before sunrise and dusk is 72 minutes after sunset. This day is split into 12 equal parts with each part
+ * being a shaah zmanis. Alternate methods of calculating a shaah zmanis are available in the
+ * subclass {@link ComplexZmanimCalendar}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getShaahZmanis72Minutes() -> Int64 {
+ return getShaahZmanisMGA();
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on alos being
+ * {@link #getAlos72Zmanis() 72} minutes zmaniyos before {@link #getSunrise() sunrise}. This calculation
+ * divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation
+ * is 72 minutes zmaniyos before sunrise and dusk is 72 minutes zmaniyos after sunset. This day
+ * is split into 12 equal parts with each part being a shaah zmanis. This is identical to 1/10th of the day
+ * from {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72Zmanis()
+ * @see #getTzais72Zmanis()
+ */
+ public func getShaahZmanis72MinutesZmanis() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos72Zmanis(), endOfDay: getTzais72Zmanis());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a dip of 90 minutes. This calculation
+ * divides the day based on the opinion of the Magen
+ * Avraham (MGA) that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes before sunrise
+ * and dusk is 90 minutes after sunset. This day is split into 12 equal parts with each part being a shaah zmanis.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getShaahZmanis90Minutes() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos90(), endOfDay: getTzais90());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on alos being
+ * {@link #getAlos90Zmanis() 90} minutes zmaniyos before {@link #getSunrise() sunrise}. This calculation divides
+ * the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes
+ * zmaniyos before sunrise and dusk is 90 minutes zmaniyos after sunset. This day is split into 12 equal
+ * parts with each part being a shaah zmanis. This is 1/8th of the day from {@link #getSunrise() sunrise} to
+ * {@link #getSunset() sunset}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos90Zmanis()
+ * @see #getTzais90Zmanis()
+ */
+ public func getShaahZmanis90MinutesZmanis() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos90Zmanis(), endOfDay: getTzais90Zmanis());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on alos being {@link
+ * #getAlos96Zmanis() 96} minutes zmaniyos before {@link #getSunrise() sunrise}. This calculation divides the
+ * day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes
+ * zmaniyos before sunrise and dusk is 96 minutes zmaniyos after sunset. This day is split into 12
+ * equal parts with each part being a shaah zmanis. This is identical to 1/7.5th of the day from
+ * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos96Zmanis()
+ * @see #getTzais96Zmanis()
+ */
+ public func getShaahZmanis96MinutesZmanis() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos96Zmanis(), endOfDay: getTzais96Zmanis());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) according to the opinion of the
+ * Chacham Yosef Harari-Raful of Yeshivat Ateret Torah calculated with alos being 1/10th
+ * of sunrise to sunset day, or {@link #getAlos72Zmanis() 72} minutes zmaniyos of such a day before
+ * {@link #getSunrise() sunrise}, and tzais is usually calculated as {@link #getTzaisAteretTorah() 40
+ * minutes} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}) after {@link #getSunset()
+ * sunset}. This day is split into 12 equal parts with each part being a shaah zmanis. Note that with this
+ * system, chatzos (mid-day) will not be the point that the sun is {@link #getSunTransit() halfway across
+ * the sky}.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getAteretTorahSunsetOffset()
+ * @see #setAteretTorahSunsetOffset(double)
+ */
+ public func getShaahZmanisAteretTorah() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) used by some zmanim according to the opinion of
+ * Rabbi Yaakov Moshe Hillel as published in the
+ * luach of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
+ * sunrise in degrees {@link #getAlos16Point1Degrees() alos 16.1°} and ending 14 minutes after sunset in
+ * degrees {@link #getTzaisGeonim3Point8Degrees() tzais 3.8°}. This day is split into 12 equal parts with
+ * each part being a shaah zmanis. Note that with this system, chatzos (mid-day) will not be the point
+ * that the sun is {@link #getSunTransit() halfway across the sky}. These shaos zmaniyos are used for Mincha
+ * Ketana and Plag Hamincha. The 14 minutes are based on 3/4 of an 18 minute mil, with half a minute
+ * added for Rav Yosi.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getMinchaKetanaAhavatShalom()
+ * @see #getPlagAhavatShalom()
+ */
+ public func getShaahZmanisAlos16Point1ToTzais3Point8() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzaisGeonim3Point8Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) used by some zmanim according to the opinion of
+ * Rabbi Yaakov Moshe Hillel as published in the
+ * luach of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
+ * sunrise in degrees {@link #getAlos16Point1Degrees() alos 16.1°} and ending 13.5 minutes after sunset in
+ * degrees {@link #getTzaisGeonim3Point7Degrees() tzais 3.7°}. This day is split into 12 equal parts with
+ * each part being a shaah zmanis. Note that with this system, chatzos (mid-day) will not be the point
+ * that the sun is {@link #getSunTransit() halfway across the sky}. These shaos zmaniyos are used for Mincha
+ * Gedola calculation.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getMinchaGedolaAhavatShalom()
+ */
+ public func getShaahZmanisAlos16Point1ToTzais3Point7() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzaisGeonim3Point7Degrees());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a dip of 96 minutes. This calculation
+ * divides the day based on the opinion of the Magen
+ * Avraham (MGA) that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes before sunrise
+ * and dusk is 96 minutes after sunset. This day is split into 12 equal parts with each part being a shaah
+ * zmanis.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getShaahZmanis96Minutes() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos96(), endOfDay: getTzais96());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) calculated using a dip of 120 minutes. This calculation
+ * divides the day based on the opinion of the Magen
+ * Avraham (MGA) that the day runs from dawn to dusk. Dawn for this calculation is 120 minutes before sunrise and
+ * dusk is 120 minutes after sunset. This day is split into 12 equal parts with each part being a shaah zmanis.
+ * Since zmanim that use this method are extremely late or early and at a point when the sky is a long time
+ * past the 18° point where the darkest point is reached, zmanim that use this should only be used
+ * lechumra only, such as delaying the start of nighttime mitzvos.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis26Degrees()
+ */
+ public func getShaahZmanis120Minutes() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos120(), endOfDay: getTzais120());
+ }
+
+ /**
+ * Method to return a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on alos being {@link
+ * #getAlos120Zmanis() 120} minutes zmaniyos before {@link #getSunrise() sunrise}. This calculation divides
+ * the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is
+ * 120 minutes zmaniyos before sunrise and dusk is 120 minutes zmaniyos after sunset. This day is
+ * split into 12 equal parts with each part being a shaah zmanis. This is identical to 1/6th of the day from
+ * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}. Since zmanim that use this method are
+ * extremely late or early and at a point when the sky is a long time past the 18° point where the darkest point
+ * is reached, zmanim that use this should only be used lechumra such as delaying the start of
+ * nighttime mitzvos.
+ *
+ * @return the long
millisecond length of a shaah zmanis. If the calculation can't be computed
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos120Zmanis()
+ * @see #getTzais120Zmanis()
+ */
+ public func getShaahZmanis120MinutesZmanis() -> Int64 {
+ return getTemporalHour(startOfDay: getAlos120Zmanis(), endOfDay: getTzais120Zmanis());
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on sunrise
+ * being 120 minutes zmaniyos or 1/6th of the day before sunrise. This is calculated as 10.75 hours after
+ * {@link #getAlos120Zmanis() dawn}. The formula used is 10.75 * {@link #getShaahZmanis120MinutesZmanis()} after
+ * {@link #getAlos120Zmanis() dawn}. Since the zman based on an extremely early alos and a very
+ * late tzais, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis120MinutesZmanis()
+ * @see #getAlos120()
+ * @see #getTzais120()
+ * @see #getPlagHamincha26Degrees()
+ * @see #getPlagHamincha120Minutes()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha120MinutesZmanis() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos120Zmanis(), endOfDay: getTzais120Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha according to the
+ * Magen Avraham with the day starting 120 minutes before sunrise and ending 120 minutes after sunset. This is
+ * calculated as 10.75 hours after {@link #getAlos120() dawn 120 minutes}. The formula used is 10.75 {@link
+ * #getShaahZmanis120Minutes()} after {@link #getAlos120()}. Since the zman based on an extremely early
+ * alos and a very late tzais, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis120Minutes()
+ * @see #getPlagHamincha26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha120Minutes() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos120(), endOfDay: getTzais120(), synchronous: true);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated as 60 minutes before sunrise. This is the time to walk the
+ * distance of 4 Mil at 15 minutes a Mil. This seems to be the opinion of the Chavas Yair in the Mekor Chaim, Orach Chaim Ch.
+ * 90, though the Mekor Chaim in Ch. 58 and in the Chut Hashani Cha 97 states that
+ * a a person walks 3 and a 1/3 mil in an hour, or an 18-minute mil. Also see the Divrei Malkiel Vol. 4, Ch. 20, page 34) who
+ * mentions the 15 minute mil lechumra by baking matzos. Also see the Maharik Ch. 173 where the questioner quoting the
+ * Ra'avan is of the opinion that the time to walk a
+ * mil is 15 minutes (5 mil in a little over an hour). There are many who believe that there is a
+ * ta'us sofer (scribe's error) in the Ra'avan, and it should 4 mil in a little over an hour, or an
+ * 18-minute mil. Time based offset calculations are based on the opinion of the
+ * Rishonim who stated that the time of the neshef
+ * (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to
+ * walk the distance of 4* mil. {@link #getTzaisGeonim9Point75Degrees()} is a related zman that is a
+ * degree-based calculation based on 60 minutes.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
+ * documentation.
+ *
+ * @see #getTzais60()
+ * @see #getPlagHamincha60Minutes()
+ * @see #getShaahZmanis60Minutes()
+ */
+ public func getAlos60() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getSunrise(), offset: -60 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated using 72 minutes zmaniyos or 1/10th of the day before
+ * sunrise. This is based on an 18-minute Mil so the time for 4 Mil is 72 minutes which is 1/10th
+ * of a day (12 * 60 = 720) based on the a day being from {@link #getSeaLevelSunrise() sea level sunrise} to
+ * {@link #getSeaLevelSunrise sea level sunset} or {@link #getSunrise() sunrise} to {@link #getSunset() sunset}
+ * (depending on the {@link #isUseElevation()} setting).
+ * The actual calculation is {@link #getSeaLevelSunrise()} - ({@link #getShaahZmanisGra()} * 1.2). This calculation
+ * is used in the calendars published by the Hisachdus Harabanim D'Artzos Habris Ve'Canada.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getShaahZmanisGra()
+ */
+ public func getAlos72Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: -1.2);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated using 96 minutes before before {@link #getSunrise() sunrise} or
+ * {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting) that is based
+ * on the time to walk the distance of 4 Mil at 24 minutes a Mil. Time based offset
+ * calculations for alos are based on the opinion of the Rishonim who stated that the time of the Neshef (time between dawn and sunrise) does not vary
+ * by the time of year or location but purely depends on the time it takes to walk the distance of 4 Mil.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ */
+ public func getAlos96() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunrise(), offset: -96 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated using 90 minutes zmaniyos or 1/8th of the day before
+ * {@link #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
+ * #isUseElevation()} setting). This is based on a 22.5-minute Mil so the time for 4 Mil is 90
+ * minutes which is 1/8th of a day (12 * 60) / 8 = 90
+ * The day is calculated from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getSeaLevelSunrise sea level
+ * sunset} or {@link #getSunrise() sunrise} to {@link #getSunset() sunset} (depending on the {@link #isUseElevation()}.
+ * The actual calculation used is {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 1.5).
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getShaahZmanisGra()
+ */
+ public func getAlos90Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: -1.5);
+ }
+
+ /**
+ * This method returns alos (dawn) calculated using 96 minutes zmaniyos or 1/7.5th of the day before
+ * {@link #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
+ * #isUseElevation()} setting). This is based on a 24-minute Mil so the time for 4 Mil is 96
+ * minutes which is 1/7.5th of a day (12 * 60 / 7.5 = 96).
+ * The day is calculated from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getSeaLevelSunrise sea level
+ * sunset} or {@link #getSunrise() sunrise} to {@link #getSunset() sunset} (depending on the {@link #isUseElevation()}.
+ * The actual calculation used is {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 1.6).
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getShaahZmanisGra()
+ */
+ public func getAlos96Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: -1.6);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated using 90 minutes before {@link #getSeaLevelSunrise() sea level
+ * sunrise} based on the time to walk the distance of 4 Mil at 22.5 minutes a Mil. Time based
+ * offset calculations for alos are based on the opinion of the Rishonim who stated that the time of the Neshef
+ * (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it
+ * takes to walk the distance of 4 Mil.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ */
+ public func getAlos90() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunrise(), offset: -90 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method should be used lechumra only and returns alos (dawn) calculated using 120 minutes
+ * before {@link #getSeaLevelSunrise() sea level sunrise} (no adjustment for elevation is made) based on the time
+ * to walk the distance of 5 Mil(Ula) at 24 minutes a Mil. Time based offset calculations
+ * for alos are based on the* opinion of the Rishonim
+ * who stated that the time of the neshef (time between dawn and sunrise) does not vary by the time of
+ * year or location but purely depends on the time it takes to walk the distance of 5 Mil(Ula). Since
+ * this time is extremely early, it should only be used lechumra, such as not eating after this time on a fast
+ * day, and not as the start time for mitzvos that can only be performed during the day.
+ *
+ * //@Deprecated This method should be used lechumra only (such as stopping to eat at this time on a fast day),
+ * since it returns a very early time, and if used lekula can result in doing mitzvos hayom
+ * too early according to most opinions. There is no current plan to remove this method from the API, and this
+ * deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ *
+ * @see #getTzais120()
+ * @see #getAlos26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getAlos120() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunrise(), offset: -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method should be used lechumra only and method returns alos (dawn) calculated using
+ * 120 minutes zmaniyos or 1/6th of the day before {@link #getSunrise() sunrise} or {@link
+ * #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting). This is based
+ * on a 24-minute Mil so the time for 5 Mil is 120 minutes which is 1/6th of a day (12 * 60 /
+ * 6 = 120). The day is calculated from {@link #getSeaLevelSunrise() sea level sunrise} to {@link
+ * #getSeaLevelSunrise sea level sunset} or {@link #getSunrise() sunrise} to {@link #getSunset() sunset} (depending
+ * on the {@link #isUseElevation()}. The actual calculation used is {@link #getSunrise()} - ({@link
+ * #getShaahZmanisGra()} * 2). Since this time is extremely early, it should only be used lechumra, such
+ * as not eating after this time on a fast day, and not as the start time for mitzvos that can only be
+ * performed during the day.
+ *
+ * //@Deprecated This method should be used lechumra only (such as stopping to eat at this time on a fast day),
+ * since it returns a very early time, and if used lekula can result in doing mitzvos hayom
+ * too early according to most opinions. There is no current plan to remove this method from the API, and this
+ * deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos120()
+ * @see #getAlos26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getAlos120Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: -2.0);
+ }
+
+ /**
+ * This method should be used lechumra only and returns alos (dawn) calculated when the sun is {@link
+ * #ZENITH_26_DEGREES 26°} below the eastern geometric horizon before sunrise. This calculation is based on the same
+ * calculation of {@link #getAlos120() 120 minutes} but uses a degree-based calculation instead of 120 exact minutes. This
+ * calculation is based on the position of the sun 120 minutes before sunrise in Jerusalem around the equinox / equilux, which
+ * calculates to 26° below {@link #GEOMETRIC_ZENITH geometric zenith}. Since this time is extremely early, it should
+ * only be used lechumra only, such as not eating after this time on a fast day, and not as the start time for
+ * mitzvos that can only be performed during the day.
+ *
+ * //@Deprecated This method should be used lechumra only (such as stopping to eat at this time on a fast day),
+ * since it returns a very early time, and if used lekula can result in doing mitzvos hayom
+ * too early according to most opinions. There is no current plan to remove this method from the API, and this
+ * deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing alos. If the calculation can't be computed such as northern
+ * and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
+ * may not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_26_DEGREES
+ * @see #getAlos120()
+ * @see #getTzais120()
+ * @see #getTzais26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getAlos26Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_26_DEGREES);
+ }
+
+ /**
+ * A method to return alos (dawn) calculated when the sun is {@link #ASTRONOMICAL_ZENITH 18°} below the
+ * eastern geometric horizon before sunrise.
+ *
+ * @return the Date
representing alos. If the calculation can't be computed such as northern
+ * and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
+ * may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ASTRONOMICAL_ZENITH
+ */
+ public func getAlos18Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ASTRONOMICAL_ZENITH);
+ }
+
+ /**
+ * A method to return alos (dawn) calculated when the sun is {@link #ZENITH_19_DEGREES 19°} below the
+ * eastern geometric horizon before sunrise. This is the Rambam's alos according to Rabbi Moshe Kosower's Maaglei Tzedek, page 88, Ayeles Hashachar Vol. I, page 12, Yom Valayla Shel Torah, Ch. 34, p. 222 and
+ * Rabbi Yaakov Shakow's Luach Ikvei Hayom.
+ *
+ * @return the Date
representing alos. If the calculation can't be computed such as northern
+ * and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
+ * may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ASTRONOMICAL_ZENITH
+ */
+ public func getAlos19Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_19_DEGREES);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated when the sun is {@link #ZENITH_19_POINT_8 19.8°} below the
+ * eastern geometric horizon before sunrise. This calculation is based on the same calculation of
+ * {@link #getAlos90() 90 minutes} but uses a degree-based calculation instead of 90 exact minutes. This calculation
+ * is based on the position of the sun 90 minutes before sunrise in Jerusalem around the equinox / equilux, which
+ * calculates to 19.8° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ *
+ * @return the Date
representing alos. If the calculation can't be computed such as northern
+ * and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
+ * may not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_19_POINT_8
+ * @see #getAlos90()
+ */
+ public func getAlos19Point8Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_19_POINT_8);
+ }
+
+ /**
+ * Method to return alos (dawn) calculated when the sun is {@link #ZENITH_16_POINT_1 16.1°} below the
+ * eastern geometric horizon before sunrise. This calculation is based on the same calculation of
+ * {@link #getAlos72() 72 minutes} but uses a degree-based calculation instead of 72 exact minutes. This calculation
+ * is based on the position of the sun 72 minutes before sunrise in Jerusalem around the equinox / equilux, which
+ * calculates to 16.1° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ *
+ * @return the Date
representing alos. If the calculation can't be computed such as northern
+ * and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
+ * may not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_16_POINT_1
+ * @see #getAlos72()
+ */
+ public func getAlos16Point1Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_16_POINT_1);
+ }
+
+ /**
+ * This method returns misheyakir based on the position of the sun when it is {@link #ZENITH_11_DEGREES
+ * 11.5°} below {@link #GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for calculating
+ * misheyakir according to some opinions. This calculation is based on the position of the sun 52 minutes
+ * before {@link #getSunrise sunrise} in Jerusalem around the equinox / equilux,
+ * which calculates to 11.5° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ * @todo recalculate.
+ *
+ * @return the Date
of misheyakir. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
+ * not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_11_POINT_5
+ */
+ public func getMisheyakir11Point5Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_11_POINT_5);
+ }
+
+ /**
+ * This method returns misheyakir based on the position of the sun when it is {@link #ZENITH_11_DEGREES
+ * 11°} below {@link #GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for calculating
+ * misheyakir according to some opinions. This calculation is based on the position of the sun 48 minutes
+ * before {@link #getSunrise sunrise} in Jerusalem daround the equinox / equilux,
+ * which calculates to 11° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ *
+ * @return If the calculation can't be computed such as northern and southern locations even south of the Arctic
+ * Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon for
+ * this calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_11_DEGREES
+ */
+ public func getMisheyakir11Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_11_DEGREES);
+ }
+
+ /**
+ * This method returns misheyakir based on the position of the sun when it is {@link #ZENITH_10_POINT_2
+ * 10.2°} below {@link #GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for calculating
+ * misheyakir according to some opinions. This calculation is based on the position of the sun 45 minutes
+ * before {@link #getSunrise sunrise} in Jerusalem around the equinox which calculates
+ * to 10.2° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ *
+ * @return the Date
of misheyakir. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be returned
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_10_POINT_2
+ */
+ public func getMisheyakir10Point2Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_10_POINT_2);
+ }
+
+ /**
+ * This method returns misheyakir based on the position of the sun when it is {@link #ZENITH_7_POINT_65
+ * 7.65°} below {@link #GEOMETRIC_ZENITH geometric zenith} (90°). The degrees are based on a 35/36 minute
+ * zman around the
+ * equinox / equilux, when the neshef (twilight) is the shortest. This time is based on Rabbi Moshe Feinstein who writes in Ohr Hachaim Vol. 4, Ch. 6)
+ * that misheyakir in New York is 35-40 minutes before sunrise, something that is a drop less than 8°.
+ * Rabbi Yisroel Taplin in Zmanei Yisrael (page 117) notes that Rabbi Yaakov Kamenetsky stated that it is not less than 36
+ * minutes before sunrise (maybe it is 40 minutes). Sefer Yisrael Vehazmanim (p. 7) quotes the Tamar Yifrach
+ * in the name of the Satmar Rov that one should be stringent
+ * not consider misheyakir before 36 minutes. This is also the accepted minhag in Lakewood that is used in the Yeshiva. This follows the opinion of Rabbi Shmuel Kamenetsky who provided the time of 35/36 minutes,
+ * but did not provide a degree-based time. Since this zman depends on the level of light, Rabbi Yaakov Shakow
+ * presented this degree-based calculations to Rabbi Kamenetsky who agreed to them.
+ *
+ * @return the Date
of misheyakir. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_7_POINT_65
+ * @see #getMisheyakir9Point5Degrees()
+ */
+ public func getMisheyakir7Point65Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_7_POINT_65);
+ }
+
+ /**
+ * This method returns misheyakir based on the position of the sun when it is {@link #ZENITH_9_POINT_5
+ * 9.5°} below {@link #GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is based on Rabbi Dovid Kronglass's
+ * Calculation of 45 minutes in Baltimore as mentioned in Divrei Chachamim No. 24 brought down by the Birur Halacha, Tinyana, Ch. 18. This calculates to
+ * 9.5°. Also see Rabbi Yaakov Yitzchok Neiman in Kovetz
+ * Eitz Chaim Vol. 9, p. 202 that the Vya'an Yosef did not want to rely on times earlier than 45 minutes in New York. This
+ * zman is also used in the calendars published by Rabbi Hershel Edelstein. As mentioned in Yisroel Vehazmanim,
+ * Rabbi Edelstein who was given the 45 minute zman by Rabbi Bick. The calendars published by the Edot Hamizrach communities also use this zman. This also
+ * follows the opinion of Rabbi Shmuel Kamenetsky who provided
+ * the time of 36 and 45 minutes, but did not provide a degree-based time. Since this zman depends on the level of
+ * light, Rabbi Yaakov Shakow presented these degree-based times to Rabbi Shmuel Kamenetsky who agreed to them.
+ *
+ * @return the Date
of misheyakir. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_9_POINT_5
+ * @see #getMisheyakir7Point65Degrees()
+ */
+ public func getMisheyakir9Point5Degrees() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_9_POINT_5);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos19Point8Degrees() 19.8°} before {@link #getSunrise() sunrise}. This
+ * time is 3 {@link #getShaahZmanis19Point8Degrees() shaos zmaniyos} (solar hours) after {@link
+ * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall
+ * with both being 19.8° below sunrise or sunset. This returns the time of 3 *
+ * {@link #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis19Point8Degrees()
+ * @see #getAlos19Point8Degrees()
+ */
+ public func getSofZmanShmaMGA19Point8Degrees() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos19Point8Degrees(), endOfDay: getTzais19Point8Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos16Point1Degrees() 16.1°} before {@link #getSunrise() sunrise}. This time
+ * is 3 {@link #getShaahZmanis16Point1Degrees() shaos zmaniyos} (solar hours) after
+ * {@link #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from
+ * dawn to nightfall with both being 16.1° below sunrise or sunset. This returns the time of
+ * 3 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getAlos16Point1Degrees()
+ */
+ public func getSofZmanShmaMGA16Point1Degrees() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos18Degrees() 18°} before {@link #getSunrise() sunrise}. This time is 3
+ * {@link #getShaahZmanis18Degrees() shaos zmaniyos} (solar hours) after {@link #getAlos18Degrees() dawn}
+ * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18°
+ * below sunrise or sunset. This returns the time of 3 * {@link #getShaahZmanis18Degrees()} after
+ * {@link #getAlos18Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis18Degrees()
+ * @see #getAlos18Degrees()
+ */
+ public func getSofZmanShmaMGA18Degrees() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos18Degrees(), endOfDay: getTzais18Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 3 {@link
+ * #getShaahZmanis72Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos72() dawn} based on the opinion
+ * of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to
+ * {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 3 * {@link
+ * #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to {@link
+ * #getSofZmanShmaMGA()} and is repeated here for clarity.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ * @see #getShaahZmanis72Minutes()
+ * @see #getAlos72()
+ * @see #getSofZmanShmaMGA()
+ */
+ public func getSofZmanShmaMGA72Minutes() -> Date? {
+ return getSofZmanShmaMGA();
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according
+ * to the opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos72Zmanis() 72} minutes zmaniyos, or 1/10th of the day before
+ * {@link #getSunrise() sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos}
+ * (solar hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of the MGA that the day is calculated
+ * from a {@link #getAlos72Zmanis() dawn} of 72 minutes zmaniyos, or 1/10th of the day before
+ * {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getTzais72Zmanis() nightfall} of 72 minutes
+ * zmaniyos after {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 3 *
+ * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis72MinutesZmanis()
+ * @see #getAlos72Zmanis()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA72MinutesZmanis() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos72Zmanis(), endOfDay: getTzais72Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according
+ * to the opinion of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 3
+ * {@link #getShaahZmanis90Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos90() dawn} based on
+ * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
+ * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 3 *
+ * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis90Minutes()
+ * @see #getAlos90()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA90Minutes() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos90(), endOfDay: getTzais90(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos90Zmanis() 90} minutes zmaniyos before {@link #getSunrise()
+ * sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos} (solar hours) after
+ * {@link #getAlos90Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
+ * #getAlos90Zmanis() dawn} of 90 minutes zmaniyos before sunrise to {@link #getTzais90Zmanis() nightfall}
+ * of 90 minutes zmaniyos after sunset. This returns the time of 3 * {@link #getShaahZmanis90MinutesZmanis()}
+ * after {@link #getAlos90Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis90MinutesZmanis()
+ * @see #getAlos90Zmanis()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA90MinutesZmanis() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos90Zmanis(), endOfDay: getTzais90Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 3
+ * {@link #getShaahZmanis96Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos96() dawn} based on
+ * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
+ * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 3 * {@link
+ * #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis96Minutes()
+ * @see #getAlos96()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA96Minutes() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos96(), endOfDay: getTzais96(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos90Zmanis() 96} minutes zmaniyos before {@link #getSunrise()
+ * sunrise}. This time is 3 {@link #getShaahZmanis96MinutesZmanis() shaos zmaniyos} (solar hours) after
+ * {@link #getAlos96Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
+ * #getAlos96Zmanis() dawn} of 96 minutes zmaniyos before sunrise to {@link #getTzais90Zmanis() nightfall}
+ * of 96 minutes zmaniyos after sunset. This returns the time of 3 * {@link #getShaahZmanis96MinutesZmanis()}
+ * after {@link #getAlos96Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis96MinutesZmanis()
+ * @see #getAlos96Zmanis()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA96MinutesZmanis() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos96Zmanis(), endOfDay: getTzais96Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) calculated
+ * as 3 hours (regular clock hours and not sha'os zmaniyos) before {@link ZmanimCalendar#getChatzos()}.
+ * Generally known as part of the "Komarno" zmanim after Rav Yitzchak Eizik of
+ * Komarno, a proponent of this calculation, it actually predates him a lot. It is the opinion of the
+ * Shach in the Nekudas Hakesef (Yoreh Deah 184), Rav Moshe Lifshitz in his commentary
+ * Lechem Mishneh on Brachos 1:2. It is
+ * next brought down about 100 years later by the Yaavetz
+ * (in his siddur, Mor Uktziah Orach
+ * Chaim 1, Lechem Shamayim, Brachos 1:2
+ * and She'elos Yaavetz vol. 1 no. 40),
+ * Rav Yitzchak Eizik of Komarno in the Ma'aseh Oreg on Mishnayos Brachos 11:2, Shevus Yaakov, Chasan Sofer and others.
+ * See Yisrael Vehazmanim vol. 1 7:3, page 55 -
+ * 62. A variant of this calculation {@link #getSofZmanShmaFixedLocal()} uses {@link #getFixedLocalChatzos() fixed
+ * local chatzos} for calculating this type of zman.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see ZmanimCalendar#getChatzos()
+ * @see #getSofZmanShmaFixedLocal()
+ * @see #getSofZmanTfila2HoursBeforeChatzos()
+ * @see #isUseAstronomicalChatzos()
+ */
+ public func getSofZmanShma3HoursBeforeChatzos() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getChatzos(), offset: -180 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) based
+ * on alos being {@link #getAlos120() 120} minutes or 1/6th of the day before {@link #getSunrise() sunrise}.
+ * This time is 3 {@link #getShaahZmanis120Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos120()
+ * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120 minutes
+ * before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of 3
+ * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early zman that
+ * is very much a chumra.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis120Minutes()
+ * @see #getAlos120()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanShmaMGA120Minutes() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos120(), endOfDay: getTzais120(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) based
+ * on the opinion that the day starts at {@link #getAlos16Point1Degrees() alos 16.1°} and ends at
+ * {@link #getSeaLevelSunset() sea level sunset}. This is the opinion of the \u05D7\u05D9\u05D3\u05D5\u05E9\u05D9
+ * \u05D5\u05DB\u05DC\u05DC\u05D5\u05EA \u05D4\u05E8\u05D6\u05F4\u05D4 and the \u05DE\u05E0\u05D5\u05E8\u05D4 \u05D4\u05D8\u05D4\u05D5\u05E8\u05D4 as
+ * mentioned by Yisrael Vehazmanim vol 1, sec. 7,
+ * ch. 3 no. 16. Three shaos zmaniyos are calculated based on this day and added to {@link
+ * #getAlos16Point1Degrees() alos} to reach this time. This time is 3 shaos zmaniyos (solar hours)
+ * after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link
+ * #getAlos16Point1Degrees() alos 16.1°} to {@link #getSeaLevelSunset() sea level sunset}.
+ * Note: Based on this calculation chatzos will not be at midday and {@link
+ * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
+ *
+ * @return the Date
of the latest zman krias shema based on this day. If the calculation can't
+ * be computed such as northern and southern locations even south of the Arctic Circle and north of the
+ * Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a nil
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos16Point1Degrees()
+ * @see #getSeaLevelSunset()
+ */
+ public func getSofZmanShmaAlos16Point1ToSunset() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos16Point1Degrees(), endOfDay: getElevationAdjustedSunset(), synchronous: false);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) based on the
+ * opinion that the day starts at {@link #getAlos16Point1Degrees() alos 16.1°} and ends at
+ * {@link #getTzaisGeonim7Point083Degrees() tzais 7.083°}. 3 shaos zmaniyos are calculated
+ * based on this day and added to {@link #getAlos16Point1Degrees() alos} to reach this time. This time is 3
+ * shaos zmaniyos (temporal hours) after {@link #getAlos16Point1Degrees() alos 16.1°} based on
+ * the opinion that the day is calculated from a {@link #getAlos16Point1Degrees() alos 16.1°} to
+ * {@link #getTzaisGeonim7Point083Degrees() tzais 7.083°}.
+ * Note: Based on this calculation chatzos will not be at midday and {@link
+ * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
+ *
+ * @return the Date
of the latest zman krias shema based on this calculation. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getAlos16Point1Degrees()
+ * @see #getTzaisGeonim7Point083Degrees()
+ */
+ public func getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzaisGeonim7Point083Degrees(), synchronous: false);
+ }
+
+ /**
+ * From the GRA in Kol Eliyahu on Berachos #173 that states that zman krias shema is calculated as half the
+ * time from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getFixedLocalChatzos() fixed local chatzos}.
+ * The GRA himself seems to contradict this when he stated that zman krias shema is 1/4 of the day from
+ * sunrise to sunset. See Sarah Lamoed #25 in Yisroel Vehazmanim Vol. III page 1016.
+ *
+ * @return the Date
of the latest zman krias shema based on this calculation. If the
+ * calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
+ * the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getFixedLocalChatzos()
+ *
+ * //@Deprecated As per a conversation Rabbi Yisroel Twerski had with Rabbi Harfenes, this zman published in
+ * the Yisrael Vehazmanim was based on a misunderstanding and should not be used. This deprecated method
+ * will be removed (likely in v3.0) pending confirmation from Rabbi Harfenes.
+ */
+ ////@Deprecated // (since="1.3", forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getSofZmanShmaKolEliyahu() -> Date? {
+ let chatzos = getFixedLocalChatzos();
+ if (chatzos == nil || getSunrise() == nil) {
+ return nil;
+ }
+ let diff = ((chatzos!.timeIntervalSince1970 - getElevationAdjustedSunrise()!.timeIntervalSince1970) * ZmanimCalendar.MINUTE_MILLIS) / 2;
+ return ComplexZmanimCalendar.getTimeOffset(time: chatzos, offset: -diff);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos19Point8Degrees() 19.8°} before {@link #getSunrise() sunrise}. This time
+ * is 4 {@link #getShaahZmanis19Point8Degrees() shaos zmaniyos} (solar hours) after {@link
+ * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
+ * nightfall with both being 19.8° below sunrise or sunset. This returns the time of 4 * {@link
+ * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis19Point8Degrees()
+ * @see #getAlos19Point8Degrees()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getSofZmanTfilaMGA19Point8Degrees() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos19Point8Degrees(), endOfDay: getTzais19Point8Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos16Point1Degrees() 16.1°} before {@link #getSunrise() sunrise}. This time
+ * is 4 {@link #getShaahZmanis16Point1Degrees() shaos zmaniyos} (solar hours) after {@link
+ * #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
+ * nightfall with both being 16.1° below sunrise or sunset. This returns the time of 4 * {@link
+ * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getAlos16Point1Degrees()
+ */
+ public func getSofZmanTfilaMGA16Point1Degrees() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos18Degrees() 18°} before {@link #getSunrise() sunrise}. This time is 4
+ * {@link #getShaahZmanis18Degrees() shaos zmaniyos} (solar hours) after {@link #getAlos18Degrees() dawn}
+ * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18°
+ * below sunrise or sunset. This returns the time of 4 * {@link #getShaahZmanis18Degrees()} after
+ * {@link #getAlos18Degrees() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis18Degrees()
+ * @see #getAlos18Degrees()
+ */
+ public func getSofZmanTfilaMGA18Degrees() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos18Degrees(), endOfDay: getTzais18Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 4
+ * {@link #getShaahZmanis72Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos72() dawn} based on
+ * the opinion of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before
+ * sunrise to {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 4 *
+ * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to
+ * {@link #getSofZmanTfilaMGA()} and is repeated here for clarity.
+ *
+ * @return the Date
of the latest zman tfila. If the calculation can't be computed such as in
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis72Minutes()
+ * @see #getAlos72()
+ * @see #getSofZmanShmaMGA()
+ */
+ public func getSofZmanTfilaMGA72Minutes() -> Date? {
+ return getSofZmanTfilaMGA();
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to the morning prayers) according to the opinion of the
+ * Magen Avraham (MGA) based on alos
+ * being {@link #getAlos72Zmanis() 72} minutes zmaniyos before {@link #getSunrise() sunrise}. This time is 4
+ * {@link #getShaahZmanis72MinutesZmanis() shaos zmaniyos} (solar hours) after {@link #getAlos72Zmanis() dawn}
+ * based on the opinion of the MGA that the day is calculated from a {@link #getAlos72Zmanis() dawn} of 72
+ * minutes zmaniyos before sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes zmaniyos
+ * after sunset. This returns the time of 4 * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis72MinutesZmanis()
+ * @see #getAlos72Zmanis()
+ */
+ public func getSofZmanTfilaMGA72MinutesZmanis() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos72Zmanis(), endOfDay: getTzais72Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 4
+ * {@link #getShaahZmanis90Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos90() dawn} based on
+ * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
+ * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 4 *
+ * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
+ *
+ * @return the Date
of the latest zman tfila. If the calculation can't be computed such as in
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis90Minutes()
+ * @see #getAlos90()
+ */
+ public func getSofZmanTfilaMGA90Minutes() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos90(), endOfDay: getTzais90(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to the morning prayers) according to the opinion of the
+ * Magen Avraham (MGA) based on alos
+ * being {@link #getAlos90Zmanis() 90} minutes zmaniyos before {@link #getSunrise() sunrise}. This time is
+ * 4 {@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos} (solar hours) after {@link #getAlos90Zmanis()
+ * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos90Zmanis() dawn}
+ * of 90 minutes zmaniyos before sunrise to {@link #getTzais90Zmanis() nightfall} of 90 minutes
+ * zmaniyos after sunset. This returns the time of 4 * {@link #getShaahZmanis90MinutesZmanis()} after
+ * {@link #getAlos90Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis90MinutesZmanis()
+ * @see #getAlos90Zmanis()
+ */
+ public func getSofZmanTfilaMGA90MinutesZmanis() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos90Zmanis(), endOfDay: getTzais90Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 4
+ * {@link #getShaahZmanis96Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos96() dawn} based on
+ * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
+ * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 4 *
+ * {@link #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
+ *
+ * @return the Date
of the latest zman tfila. If the calculation can't be computed such as in
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis96Minutes()
+ * @see #getAlos96()
+ */
+ public func getSofZmanTfilaMGA96Minutes() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos96(), endOfDay: getTzais96(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to the morning prayers) according to the opinion of the
+ * Magen Avraham (MGA) based on alos
+ * being {@link #getAlos96Zmanis() 96} minutes zmaniyos before {@link #getSunrise() sunrise}. This time is
+ * 4 {@link #getShaahZmanis96MinutesZmanis() shaos zmaniyos} (solar hours) after {@link #getAlos96Zmanis()
+ * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos96Zmanis() dawn}
+ * of 96 minutes zmaniyos before sunrise to {@link #getTzais96Zmanis() nightfall} of 96 minutes
+ * zmaniyos after sunset. This returns the time of 4 * {@link #getShaahZmanis96MinutesZmanis()} after
+ * {@link #getAlos96Zmanis() dawn}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis90MinutesZmanis()
+ * @see #getAlos90Zmanis()
+ */
+ public func getSofZmanTfilaMGA96MinutesZmanis() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos96Zmanis(), endOfDay: getTzais96Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) according to the opinion
+ * of the Magen Avraham (MGA) based on
+ * alos being {@link #getAlos120() 120} minutes before {@link #getSunrise() sunrise} . This time is 4
+ * {@link #getShaahZmanis120Minutes() shaos zmaniyos} (solar hours) after {@link #getAlos120() dawn}
+ * based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120
+ * minutes before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of
+ * 4 * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early zman
+ * that is very much a chumra.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis120Minutes()
+ * @see #getAlos120()
+ */
+ public func getSofZmanTfilaMGA120Minutes() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos120(), endOfDay: getTzais120(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) calculated as 2 hours
+ * before {@link ZmanimCalendar#getChatzos()}. This is based on the opinions that calculate
+ * sof zman krias shema as {@link #getSofZmanShma3HoursBeforeChatzos()}. This returns the time of 2 hours
+ * before {@link ZmanimCalendar#getChatzos()}.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
+ * it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see ZmanimCalendar#getChatzos()
+ * @see #getSofZmanShma3HoursBeforeChatzos()
+ */
+ public func getSofZmanTfila2HoursBeforeChatzos() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getChatzos(), offset: -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method returns mincha gedola calculated as 30 minutes after {@link #getChatzos() chatzos}
+ * and not 1/2 of a {@link #getShaahZmanisGra() shaah zmanis} after {@link #getChatzos() chatzos} as
+ * calculated by {@link #getMinchaGedola}. Some use this time to delay the start of mincha in the winter when
+ * 1/2 of a {@link #getShaahZmanisGra() shaah zmanis} is less than 30 minutes. See
+ * {@link #getMinchaGedolaGreaterThan30()} for a convenience method that returns the later of the 2 calculations. One
+ * should not use this time to start mincha before the standard {@link #getMinchaGedola() mincha gedola}.
+ * See Shulchan Aruch Orach Chayim 234:1 and
+ * the Shaar Hatziyon seif katan ches. Since this calculation is a fixed 30 minutes of regular clock time after
+ * chatzos, even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is false
, this mincha
+ * gedola time will be affected by {@link #isUseAstronomicalChatzos()} and not by
+ * {@link #isUseAstronomicalChatzosForOtherZmanim()}.
+ *
+ * @return the Date
of 30 minutes after chatzos. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getMinchaGedola()
+ * @see #getMinchaGedolaGreaterThan30()
+ * @see #getChatzos()
+ * @see #isUseAstronomicalChatzos()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ */
+ public func getMinchaGedola30Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getChatzos(), offset: ComplexZmanimCalendar.MINUTE_MILLIS * 30);
+ }
+
+ /**
+ * This method returns the time of mincha gedola according to the Magen Avraham with the day starting 72
+ * minutes before sunrise and ending 72 minutes after sunset. This is the earliest time to pray mincha. For
+ * more information on this see the documentation on {@link #getMinchaGedola() mincha gedola}. This is
+ * calculated as 6.5 {@link #getTemporalHour() solar hours} after alos. The calculation used is 6.5 *
+ * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() alos}. If {@link
+ * #isUseAstronomicalChatzosForOtherZmanim()} is set to true
, the calculation will be based on 0.5
+ * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based sha'ah zmanis} between {@link #getChatzos()}
+ * and {@link #getTzais72()} after {@link #getChatzos()}.
+ *
+ * @see #getAlos72()
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetana()
+ * @see ZmanimCalendar#getMinchaGedola()
+ * @see #getChatzos()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaGedola72Minutes() -> Date? {
+ if (isUseAstronomicalChatzosForOtherZmanim()) {
+ return getHalfDayBasedZman(startOfHalfDay: getChatzos(), endOfHalfDay: getTzais72(), hours: 0.5);
+ } else {
+ return getMinchaGedola(startOfDay: getAlos72(), endOfDay: getTzais72(), synchronous: true);
+ }
+ }
+
+ /**
+ * This method returns the time of mincha gedola according to the Magen Avraham with the day starting and
+ * ending 16.1° below the horizon. This is the earliest time to pray mincha. For more information on
+ * this see the documentation on {@link #getMinchaGedola() mincha gedola}. This is calculated as 6.5
+ * {@link #getTemporalHour() solar hours} after alos. The calculation used is 6.5 *
+ * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() alos}. If {@link
+ * #isUseAstronomicalChatzosForOtherZmanim()} is set to true
, the calculation will be based on 0.5
+ * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based sha'ah zmanis} between {@link #getChatzos()}
+ * and {@link #getAlos16Point1Degrees()} after {@link #getChatzos()}.
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetana()
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaGedola16Point1Degrees() -> Date? {
+ if (isUseAstronomicalChatzosForOtherZmanim()) {
+ return getHalfDayBasedZman(startOfHalfDay: getChatzos(), endOfHalfDay: getTzais16Point1Degrees(), hours: 0.5);
+ } else {
+ return getMinchaGedola(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ }
+
+ /**
+ * This method returns the time of mincha gedola based on the opinion of Rabbi Yaakov Moshe Hillel as published in the luach
+ * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that mincha gedola is calculated as half a shaah
+ * zmanis after chatzos with shaos zmaniyos calculated based on a day starting 72 minutes befoe sunrise
+ * {@link #getAlos16Point1Degrees() alos 16.1°} and ending 13.5 minutes after sunset {@link
+ * #getTzaisGeonim3Point7Degrees() tzais 3.7°}. Mincha gedola is the earliest time to pray mincha.
+ * The later of this time or 30 clock minutes after chatzos is returned. See {@link #getMinchaGedolaGreaterThan30()}
+ * (though that calculation is based on mincha gedola GRA).
+ * For more information about mincha gedola see the documentation on {@link #getMinchaGedola() mincha gedola}.
+ * Since calculation of this zman involves chatzos that is offset from the center of the astronomical day,
+ * {@link #isUseAstronomicalChatzosForOtherZmanim()} is N/A here.
+ * @return the Date
of the mincha gedola. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
+ * reach low enough below the horizon for this calculation, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos16Point1Degrees()
+ * @see #getTzaisGeonim3Point7Degrees()
+ * @see #getShaahZmanisAlos16Point1ToTzais3Point7()
+ * @see #getMinchaGedolaGreaterThan30()
+ */
+ public func getMinchaGedolaAhavatShalom() -> Date? {
+ if (getMinchaGedola30Minutes() == nil || getMinchaGedola() == nil) {
+ return nil;
+ } else {
+ if getMinchaGedola30Minutes()!.timeIntervalSince1970 > ComplexZmanimCalendar.getTimeOffset(time: getChatzos(), offset: getShaahZmanisAlos16Point1ToTzais3Point7() / 2)!.timeIntervalSince1970 {
+ return getMinchaGedola30Minutes()
+ } else {
+ return ComplexZmanimCalendar.getTimeOffset(time: getChatzos(), offset: getShaahZmanisAlos16Point1ToTzais3Point7() / 2)
+ }
+ }
+ }
+
+ /**
+ * FIXME check for syncronous
+ * This is a convenience method that returns the later of {@link #getMinchaGedola()} and
+ * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisGra() shaah zmanis} is
+ * less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise {@link #getMinchaGedola()}
+ * will be returned. Since this calculation can be an offset of chatzos (if 30 clock minutes > 1/2 of a shaah
+ * zmanis), even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is false
, this mincha time
+ * may be affected by {@link #isUseAstronomicalChatzos()}.
+ *
+ * @return the Date
of the later of {@link #getMinchaGedola()} and {@link #getMinchaGedola30Minutes()}.
+ * If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
+ * where the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getMinchaGedola()
+ * @see #getMinchaGedola30Minutes()
+ * @see #isUseAstronomicalChatzos()
+ *
+ */
+ public func getMinchaGedolaGreaterThan30() -> Date? {
+ if (getMinchaGedola30Minutes() == nil || getMinchaGedola() == nil) {
+ return nil;
+ } else {
+ if getMinchaGedola30Minutes()!.timeIntervalSince1970 > getMinchaGedola()!.timeIntervalSince1970 {
+ return getMinchaGedola30Minutes()
+ } else {
+ return getMinchaGedola()
+ }
+ }
+ }
+
+ /**
+ * This method returns the time of mincha ketana according to the Magen Avraham with the day starting and
+ * ending 16.1° below the horizon. This is the preferred earliest time to pray mincha according to the
+ * opinion of the Rambam and others. For more information on
+ * this see the documentation on {@link #getMinchaGedola() mincha gedola}. This is calculated as 9.5
+ * {@link #getTemporalHour() solar hours} after alos. The calculation used is 9.5 *
+ * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() alos}.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetana()
+ * @return the Date
of the time of mincha ketana. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaKetana16Point1Degrees() -> Date? {
+ return getMinchaKetana(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method returns the time of mincha ketana based on the opinion of Rabbi Yaakov Moshe Hillel as published in the luach
+ * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that mincha ketana is calculated as 2.5 shaos
+ * zmaniyos before {@link #getTzaisGeonim3Point8Degrees() tzais 3.8°} with shaos zmaniyos
+ * calculated based on a day starting at {@link #getAlos16Point1Degrees() alos 16.1°} and ending at
+ * tzais 3.8°. Mincha ketana is the preferred earliest time to pray mincha according to
+ * the opinion of the Rambam and others. For more information
+ * on this see the documentation on {@link #getMinchaKetana() mincha ketana}.
+ *
+ * @return the the Date
of the time of mincha ketana. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the
+ * sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
+ * @see #getMinchaGedolaAhavatShalom()
+ * @see #getPlagAhavatShalom()
+ */
+ public func getMinchaKetanaAhavatShalom() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(
+ time: getTzaisGeonim3Point8Degrees(),
+ offset: -Double(getShaahZmanisAlos16Point1ToTzais3Point8()) * 2.5);
+ }
+
+ /**
+ * This method returns the time of mincha ketana according to the Magen Avraham with the day
+ * starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the preferred earliest time to pray
+ * mincha according to the opinion of the Rambam
+ * and others. For more information on this see the documentation on {@link #getMinchaGedola() mincha gedola}.
+ * This is calculated as 9.5 {@link #getShaahZmanis72Minutes()} after alos. The calculation used is 9.5 *
+ * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() alos}.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetana()
+ * @return the Date
of the time of mincha ketana. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, anil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaKetana72Minutes() -> Date? {
+ return getMinchaKetana(startOfDay: getAlos72(), endOfDay: getTzais72(), synchronous: true);
+ }
+
+ /**
+ * This method returns the time of plag hamincha according to the Magen Avraham with the day starting 60
+ * minutes before sunrise and ending 60 minutes after sunset. This is calculated as 10.75 hours after
+ * {@link #getAlos60() dawn}. The formula used is 10.75 {@link #getShaahZmanis60Minutes()} after {@link #getAlos60()}.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis60Minutes()
+ * @see #getAlos60()
+ * @see #getTzais60()
+ */
+ public func getPlagHamincha60Minutes() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos60(), endOfDay: getTzais60(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha according to the
+ * Magen Avraham with the day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is calculated
+ * as 10.75 hours after {@link #getAlos72() dawn}. The formula used is 10.75 {@link #getShaahZmanis72Minutes()} after
+ * {@link #getAlos72()}. Since plag by this calculation can occur after sunset, it should only be used
+ * lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis72Minutes()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha72Minutes() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos72(), endOfDay: getTzais72(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha according to the
+ * Magen Avraham with the day starting 90 minutes before sunrise and ending 90 minutes after sunset. This is calculated
+ * as 10.75 hours after {@link #getAlos90() dawn}. The formula used is 10.75 {@link #getShaahZmanis90Minutes()} after
+ * {@link #getAlos90()}. Since plag by this calculation can occur after sunset, it should only be used
+ * lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis90Minutes()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha90Minutes() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos90(), endOfDay: getTzais90(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha according to the Magen
+ * Avraham with the day starting 96 minutes before sunrise and ending 96 minutes after sunset. This is calculated as 10.75
+ * hours after {@link #getAlos96() dawn}. The formula used is 10.75 {@link #getShaahZmanis96Minutes()} after
+ * {@link #getAlos96()}. Since plag by this calculation can occur after sunset, it should only be used
+ * lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanis96Minutes()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha96Minutes() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos96(), endOfDay: getTzais96(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha. This is calculated
+ * as 10.75 hours after {@link #getAlos96Zmanis() dawn}. The formula used is 10.75 * {@link
+ * #getShaahZmanis96MinutesZmanis()} after {@link #getAlos96Zmanis() dawn}. Since plag by this calculation can
+ * occur after sunset, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha96MinutesZmanis() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos96Zmanis(), endOfDay: getTzais96Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha. This is calculated
+ * as 10.75 hours after {@link #getAlos90Zmanis() dawn}. The formula used is 10.75 * {@link
+ * #getShaahZmanis90MinutesZmanis()} after {@link #getAlos90Zmanis() dawn}. Since plag by this calculation can
+ * occur after sunset, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha90MinutesZmanis() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos90Zmanis(), endOfDay: getTzais90Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha. This is calculated as
+ * 10.75 hours after {@link #getAlos72Zmanis()}. The formula used is 10.75 * {@link #getShaahZmanis72MinutesZmanis()} after
+ * {@link #getAlos72Zmanis() dawn}. Since plag by this calculation can occur after sunset, it should only be used
+ * lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha72MinutesZmanis() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos72Zmanis(), endOfDay: getTzais72Zmanis(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on the
+ * opinion that the day starts at {@link #getAlos16Point1Degrees() alos 16.1°} and ends at {@link
+ * #getTzais16Point1Degrees() tzais 16.1°}. This is calculated as 10.75 hours zmaniyos
+ * after {@link #getAlos16Point1Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis16Point1Degrees()}
+ * after {@link #getAlos16Point1Degrees()}. Since plag by this calculation can occur after sunset, it
+ * should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha16Point1Degrees() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on the
+ * opinion that the day starts at {@link #getAlos19Point8Degrees() alos 19.8°} and ends at {@link
+ * #getTzais19Point8Degrees() tzais 19.8°}. This is calculated as 10.75 hours zmaniyos
+ * after {@link #getAlos19Point8Degrees() dawn}. The formula used is 10.75 * {@link
+ * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees()}. Since plag by this
+ * calculation can occur after sunset, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis19Point8Degrees()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha19Point8Degrees() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos19Point8Degrees(), endOfDay: getTzais19Point8Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on the
+ * opinion that the day starts at {@link #getAlos26Degrees() alos 26°} and ends at {@link
+ * #getTzais26Degrees() tzais 26°}. This is calculated as 10.75 hours zmaniyos after {@link
+ * #getAlos26Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis26Degrees()} after {@link
+ * #getAlos26Degrees()}. Since the zman based on an extremely early alos and a very late
+ * tzais, it should only be used lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis26Degrees()
+ * @see #getPlagHamincha120Minutes()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha26Degrees() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos26Degrees(), endOfDay: getTzais26Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on the
+ * opinion that the day starts at {@link #getAlos18Degrees() alos 18°} and ends at {@link
+ * #getTzais18Degrees() tzais 18°}. This is calculated as 10.75 hours zmaniyos after {@link
+ * #getAlos18Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis18Degrees()} after {@link
+ * #getAlos18Degrees()}. Since plag by this calculation can occur after sunset, it should only be used
+ * lechumra.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time (often after
+ * shkiah), and if used lekula can result in chillul Shabbos etc. There is no
+ * current plan to remove this method from the API, and this deprecation is intended to alert developers
+ * of the danger of using it.
+ *
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
+ * the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis18Degrees()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagHamincha18Degrees() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos18Degrees(), endOfDay: getTzais18Degrees(), synchronous: true);
+ }
+
+ /**
+ * This method should be used lechumra only and returns the time of plag hamincha based on the opinion
+ * that the day starts at {@link #getAlos16Point1Degrees() alos 16.1°} and ends at {@link #getSunset() sunset}.
+ * 10.75 shaos zmaniyos are calculated based on this day and added to {@link #getAlos16Point1Degrees()
+ * alos} to reach this time. This time is 10.75 shaos zmaniyos (temporal hours) after {@link
+ * #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link #getAlos16Point1Degrees()
+ * dawn} of 16.1 degrees before sunrise to {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 10.75 *
+ * the calculated shaah zmanis after {@link #getAlos16Point1Degrees() dawn}. Since plag by this
+ * calculation can occur after sunset, it should only be used lechumra.
+ *
+ *
+ * @return the Date
of the plag. If the calculation can't be computed such as northern and southern
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
+ * low enough below the horizon for this calculation, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos16Point1Degrees()
+ * @see #getSeaLevelSunset()
+ */
+ //@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getPlagAlosToSunset() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos16Point1Degrees(), endOfDay: getElevationAdjustedSunset(), synchronous: false);
+ }
+
+ /**
+ * This method returns the time of plag hamincha based on the opinion that the day starts at
+ * {@link #getAlos16Point1Degrees() alos 16.1°} and ends at {@link #getTzaisGeonim7Point083Degrees()
+ * tzais}. 10.75 shaos zmaniyos are calculated based on this day and added to {@link
+ * #getAlos16Point1Degrees() alos} to reach this time. This time is 10.75 shaos zmaniyos (temporal
+ * hours) after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a
+ * {@link #getAlos16Point1Degrees() dawn} of 16.1 degrees before sunrise to
+ * {@link #getTzaisGeonim7Point083Degrees() tzais} . This returns the time of 10.75 * the calculated
+ * shaah zmanis after {@link #getAlos16Point1Degrees() dawn}.
+ *
+ * @return the Date
of the plag. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
+ * reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos16Point1Degrees()
+ * @see #getTzaisGeonim7Point083Degrees()
+ */
+ public func getPlagAlos16Point1ToTzaisGeonim7Point083Degrees() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzaisGeonim7Point083Degrees(), synchronous: false);
+ }
+
+ /**
+ * This method returns the time of plag hamincha (the earliest time that Shabbos can be started) based on the
+ * opinion of Rabbi Yaakov Moshe Hillel as published in
+ * the luach of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that that plag hamincha is calculated
+ * as 1.25 shaos zmaniyos before {@link #getTzaisGeonim3Point8Degrees() tzais 3.8°} with shaos
+ * zmaniyos calculated based on a day starting at {@link #getAlos16Point1Degrees() alos 16.1°} and
+ * ending at tzais 3.8°.
+ *
+ * @return the Date
of the plag. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
+ * reach low enough below the horizon for this calculation, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
+ * @see #getMinchaGedolaAhavatShalom()
+ * @see #getMinchaKetanaAhavatShalom()
+ */
+ public func getPlagAhavatShalom() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getTzaisGeonim3Point8Degrees(), offset: -Double(getShaahZmanisAlos16Point1ToTzais3Point8()) * 1.25);
+ }
+
+ /**
+ * Method to return the beginning of bain hashmashos of Rabbeinu Tam calculated when the sun is
+ * {@link #ZENITH_13_POINT_24 13.24°} below the western {@link #GEOMETRIC_ZENITH geometric horizon} (90°)
+ * after sunset. This calculation is based on the same calculation of {@link #getBainHashmashosRT58Point5Minutes()
+ * bain hashmashos Rabbeinu Tam 58.5 minutes} but uses a degree-based calculation instead of 58.5 exact
+ * minutes. This calculation is based on the position of the sun 58.5 minutes after sunset in Jerusalem around the equinox / equilux,
+ * which calculates to 13.24° below {@link #GEOMETRIC_ZENITH geometric zenith}.
+ * NOTE: As per Yisrael Vehazmanim Vol. III page 1028, No. 50, a dip of slightly less than 13° should be used.
+ * Calculations show that the proper dip to be 13.2456° (truncated to 13.24 that provides about 1.5 second
+ * earlier (lechumra) time) below the horizon at that time. This makes a difference of 1 minute and 10
+ * seconds in Jerusalem during the Equinox, and 1 minute 29 seconds during the solstice as compared to the proper
+ * 13.24° versus 13°. For NY during the solstice, the difference is 1 minute 56 seconds.
+ * @todo recalculate the above based on equilux/equinox calculations.
+ *
+ * @return the Date
of the sun being 13.24° below {@link #GEOMETRIC_ZENITH geometric zenith}
+ * (90°). If the calculation can't be computed such as northern and southern locations even south of the
+ * Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon
+ * for this calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_13_POINT_24
+ * @see #getBainHashmashosRT58Point5Minutes()
+ */
+ public func getBainHashmashosRT13Point24Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_13_POINT_24);
+ }
+
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosRT13Point24Degrees()}.
+ * @return the properly spelled version.
+ */
+ //@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosRT13Point24Degrees() -> Date? {
+ return getBainHashmashosRT13Point24Degrees();
+ }
+
+ /**
+ * This method returns the beginning of Bain hashmashos of Rabbeinu Tam calculated as a 58.5
+ * minute offset after sunset. bain hashmashos is 3/4 of a Mil before tzais or 3 1/4
+ * Mil after sunset. With a Mil calculated as 18 minutes, 3.25 * 18 = 58.5 minutes.
+ *
+ * @return the Date
of 58.5 minutes after sunset. If the calculation can't be computed such as in the
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
+ * not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ */
+ public func getBainHashmashosRT58Point5Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 58.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosRT58Point5Minutes()}.
+ * @return the properly spelled version.
+ */
+ //@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosRT58Point5Minutes() -> Date? {
+ return getBainHashmashosRT58Point5Minutes();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos based on the calculation of 13.5 minutes (3/4 of an
+ * 18-minute Mil) before shkiah calculated as {@link #getTzaisGeonim7Point083Degrees() 7.083°}.
+ *
+ * @return the Date
of the bain hashmashos of Rabbeinu Tam in this calculation. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getTzaisGeonim7Point083Degrees()
+ */
+ public func getBainHashmashosRT13Point5MinutesBefore7Point083Degrees() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(
+ time: getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_7_POINT_083),
+ offset: -13.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosRT13Point5MinutesBefore7Point083Degrees()}.
+ * @return the properly spelled version.
+ */
+ //@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosRT13Point5MinutesBefore7Point083Degrees() -> Date? {
+ return getBainHashmashosRT13Point5MinutesBefore7Point083Degrees();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos of Rabbeinu Tam calculated according to the
+ * opinion of the Divrei Yosef (see Yisrael Vehazmanim) calculated 5/18th (27.77%) of the time between
+ * alos (calculated as 19.8° before sunrise) and sunrise. This is added to sunset to arrive at the time
+ * for bain hashmashos of Rabbeinu Tam.
+ *
+ * @return the Date
of bain hashmashos of Rabbeinu Tam for this calculation. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getBainHashmashosRT2Stars() -> Date? {
+ let alos19Point8 = getAlos19Point8Degrees();
+ let sunrise = getElevationAdjustedSunrise();
+ if (alos19Point8 == nil || sunrise == nil) {
+ return nil;
+ }
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: ((sunrise!.timeIntervalSince1970 - alos19Point8!.timeIntervalSince1970) * ComplexZmanimCalendar.MINUTE_MILLIS) * (5 / 18));
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosRT2Stars()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosRT2Stars() -> Date? {
+ return getBainHashmashosRT2Stars();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos (twilight) according to the Yereim (Rabbi Eliezer of Metz) calculated as 18 minutes
+ * or 3/4 of a 24-minute Mil before sunset. According to the Yereim, bain hashmashos starts 3/4
+ * of a Mil before sunset and tzais or nightfall starts at sunset.
+ *
+ * @return the Date
of 18 minutes before sunset. If the calculation can't be computed such as in the
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
+ * not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #getBainHashmashosYereim3Point05Degrees()
+ */
+ public func getBainHashmashosYereim18Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: -18 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim18Minutes()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim18Minutes() -> Date? {
+ return getBainHashmashosYereim18Minutes();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos (twilight) according to the Yereim (Rabbi Eliezer of Metz) calculated as the sun's
+ * position 3.05° above the horizon around the equinox / equilux,
+ * its position 18 minutes or 3/4 of an 24-minute mil before sunset. According to the Yereim, bain
+ * hashmashos starts 3/4 of a Mil before sunset and tzais or nightfall starts at sunset.
+ * Note that lechumra (of about 14 seconds) a refraction value of 0.5166° as opposed to the traditional
+ * 0.566° is used. This is more inline with the actual refraction in Eretz Yisrael and is brought down
+ * by Rabbi
+ * Yedidya Manet in his Zmanei Halacha
+ * Lema’aseh (p. 11). That is the first source that I am aware of that calculates degree-based Yereim
+ * zmanim. The 0.5166° refraction is also used by the Luach Itim
+ * Lebinah. Calculating the Yereim's bain hashmashos using 18-minute based degrees is also suggested
+ * in the upcoming 8th edition of the zmanim Kehilchasam. For more details, see the article The Yereim’s Bein Hashmashos.
+ *
+ * @todo recalculate based on equinox/equilux
+ * @return the Date
of the sun's position 3.05° minutes before sunset. If the calculation can't
+ * be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
+ * rise, and one where it does not set, a nil
will be returned. See detailed explanation on
+ * top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_MINUS_3_POINT_05
+ * @see #getBainHashmashosYereim18Minutes()
+ * @see #getBainHashmashosYereim2Point8Degrees()
+ * @see #getBainHashmashosYereim2Point1Degrees()
+ */
+ public func getBainHashmashosYereim3Point05Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_MINUS_3_POINT_05);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim3Point05Degrees()}.
+ * @return the properly spelled version.
+ */
+ // //@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim3Point05Degrees() -> Date? {
+ return getBainHashmashosYereim3Point05Degrees();
+ }
+
+
+ /**
+ * This method returns the beginning of bain hashmashos (twilight) according to the Yereim (Rabbi Eliezer of Metz) calculated as 16.875
+ * minutes or 3/4 of a 22.5-minute Mil before sunset. According to the Yereim, bain hashmashos
+ * starts 3/4 of a Mil before sunset and tzais or nightfall starts at sunset.
+ *
+ * @return the Date
of 16.875 minutes before sunset. If the calculation can't be computed such as in the
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
+ * not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getBainHashmashosYereim2Point8Degrees()
+ */
+ public func getBainHashmashosYereim16Point875Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: -16.875 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim16Point875Minutes()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim16Point875Minutes() -> Date? {
+ return getBainHashmashosYereim16Point875Minutes();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos (twilight) according to the Yereim (Rabbi Eliezer of Metz) calculated as the sun's
+ * position 2.8° above the horizon around the equinox / equilux,
+ * its position 16.875 minutes or 3/4 of an 18-minute Mil before sunset. According to the Yereim, bain
+ * hashmashos starts 3/4 of a Mil before sunset and tzais or nightfall starts at sunset.
+ * Details, including how the degrees were calculated can be seen in the documentation of
+ * {@link #getBainHashmashosYereim3Point05Degrees()}.
+ *
+ * @return the Date
of the sun's position 2.8° minutes before sunset. If the calculation can't
+ * be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
+ * rise, and one where it does not set, a nil
will be returned. See detailed explanation on
+ * top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_MINUS_2_POINT_8
+ * @see #getBainHashmashosYereim16Point875Minutes()
+ * @see #getBainHashmashosYereim3Point05Degrees()
+ * @see #getBainHashmashosYereim2Point1Degrees()
+ */
+ public func getBainHashmashosYereim2Point8Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_MINUS_2_POINT_8);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim2Point8Degrees()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim2Point8Degrees() -> Date? {
+ return getBainHashmashosYereim2Point8Degrees();
+ }
+
+
+ /**
+ * This method returns the beginning of bain hashmashos (twilight) according to the Yereim (Rabbi Eliezer of Metz) calculated as 13.5 minutes
+ * or 3/4 of an 18-minute Mil before sunset. According to the Yereim, bain hashmashos starts 3/4 of
+ * a Mil before sunset and tzais or nightfall starts at sunset.
+ *
+ * @return the Date
of 13.5 minutes before sunset. If the calculation can't be computed such as in the
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
+ * not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getBainHashmashosYereim2Point1Degrees()
+ */
+ public func getBainHashmashosYereim13Point5Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: -13.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim13Point5Minutes()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim13Point5Minutes() -> Date? {
+ return getBainHashmashosYereim13Point5Minutes();
+ }
+
+ /**
+ * This method returns the beginning of bain hashmashos according to the Yereim (Rabbi Eliezer of Metz) calculated as the sun's
+ * position 2.1° above the horizon around the equinox / equilux in
+ * Yerushalayim, its position 13.5 minutes or 3/4 of an 18-minute Mil before sunset. According to the Yereim,
+ * bain hashmashos starts 3/4 of a mil before sunset and tzais or nightfall starts at sunset.
+ * Details, including how the degrees were calculated can be seen in the documentation of
+ * {@link #getBainHashmashosYereim3Point05Degrees()}.
+ *
+ * @return the Date
of the sun's position 2.1° minutes before sunset. If the calculation can't be
+ * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and
+ * one where it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #ZENITH_MINUS_2_POINT_1
+ * @see #getBainHashmashosYereim13Point5Minutes()
+ * @see #getBainHashmashosYereim2Point8Degrees()
+ * @see #getBainHashmashosYereim3Point05Degrees()
+ */
+ public func getBainHashmashosYereim2Point1Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_MINUS_2_POINT_1);
+ }
+
+ /**
+ * Misspelled method name that should be {@link #getBainHashmashosYereim2Point1Degrees()}.
+ * @return the properly spelled version.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getBainHasmashosYereim2Point1Degrees() -> Date? {
+ return getBainHashmashosYereim2Point1Degrees();
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated at the
+ * sun's position at {@link #ZENITH_3_POINT_7 3.7°} below the western horizon.
+ *
+ * @return the Date
representing the time when the sun is 3.7° below sea level.
+ * @see #ZENITH_3_POINT_7
+ */
+ public func getTzaisGeonim3Point7Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_3_POINT_7);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated at the
+ * sun's position at {@link #ZENITH_3_POINT_8 3.8°} below the western horizon.
+ *
+ * @return the Date
representing the time when the sun is 3.8° below sea level.
+ * @see #ZENITH_3_POINT_8
+ */
+ public func getTzaisGeonim3Point8Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_3_POINT_8);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated at the
+ * sun's position at {@link #ZENITH_5_POINT_95 5.95°} below the western horizon.
+ *
+ * @return the Date
representing the time when the sun is 5.95° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_5_POINT_95
+ */
+ public func getTzaisGeonim5Point95Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_5_POINT_95);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a Mil based on an 18
+ * minute Mil, or 13.5 minutes. It is the sun's position at {@link #ZENITH_3_POINT_65 3.65°} below the western
+ * horizon. This is a very early zman and should not be relied on without Rabbinical guidance.
+ *
+ * @return the Date
representing the time when the sun is 3.65° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * //@Deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
+ * the around the
+ * equinox / equilux in Jerusalem.
+ * @see #ZENITH_3_POINT_65
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getTzaisGeonim3Point65Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_3_POINT_65);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a Mil based on an 18
+ * minute Mil, or 13.5 minutes. It is the sun's position at {@link #ZENITH_3_POINT_676 3.676°} below the western
+ * horizon based on the calculations of Stanley Fishkind. This is a very early zman and should not be
+ * relied on without Rabbinical guidance.
+ *
+ * @return the Date
representing the time when the sun is 3.676° below sea level. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * //@Deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
+ * the around the
+ * equinox / equilux in Jerusalem.
+ * @see #ZENITH_3_POINT_676
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getTzaisGeonim3Point676Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_3_POINT_676);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a mil based
+ * on a 24-minute Mil, or 18 minutes. It is the sun's position at {@link #ZENITH_4_POINT_61 4.61°} below the
+ * western horizon. This is a very early zman and should not be relied on without Rabbinical guidance.
+ *
+ * @return the Date
representing the time when the sun is 4.61° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_4_POINT_61
+ */
+ public func getTzaisGeonim4Point61Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_4_POINT_61);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a Mil, based on a 22.5
+ * minute Mil, or 16 7/8 minutes. It is the sun's position at {@link #ZENITH_4_POINT_37 4.37°} below the western
+ * horizon. This is a very early zman and should not be relied on without Rabbinical guidance.
+ *
+ * @return the Date
representing the time when the sun is 4.37° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_4_POINT_37
+ */
+ public func getTzaisGeonim4Point37Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_4_POINT_37);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a 24-minute Mil,
+ * based on a Mil being 24 minutes, and is calculated as 18 + 2 + 4 for a total of 24 minutes. It is the
+ * sun's position at {@link #ZENITH_5_POINT_88 5.88°} below the western horizon. This is a very early
+ * zman and should not be relied on without Rabbinical guidance.
+ *
+ * @todo Additional detailed documentation needed.
+ * @return the Date
representing the time when the sun is 5.88° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_5_POINT_88
+ */
+ public func getTzaisGeonim5Point88Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_5_POINT_88);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 3/4
+ * of a Mil based on the
+ * sun's position at {@link #ZENITH_4_POINT_8 4.8°} below the western horizon. This is based on Rabbi Leo Levi's
+ * calculations. This is the This is a very early zman and should not be relied on without Rabbinical guidance.
+ * @todo Additional documentation needed.
+ *
+ * @return the Date
representing the time when the sun is 4.8° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_4_POINT_8
+ */
+ public func getTzaisGeonim4Point8Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_4_POINT_8);
+ }
+
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim as calculated by
+ * Rabbi Yechiel Michel Tucazinsky. It is
+ * based on of the position of the sun no later than {@link #getTzaisGeonim6Point45Degrees() 31 minutes} after sunset
+ * in Jerusalem the height of the summer solstice and is 28 minutes after shkiah around the equinox / equilux. This
+ * computes to 6.45° below the western horizon.
+ * @todo Additional documentation details needed.
+ *
+ * @return the Date
representing the time when the sun is 6.45° below sea level. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_6_POINT_45
+ */
+ public func getTzaisGeonim6Point45Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_6_POINT_45);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated when the
+ * sun's position {@link #ZENITH_7_POINT_083 7.083° (or 7° 5\u2032}) below the western horizon. This is often
+ * referred to as 7°5' or 7° and 5 minutes. This calculation is based on the observation of 3 medium sized
+ * stars by Dr. Baruch (Berthold) Cohn in his luach Tabellen enthaltend die Zeitangaben für
+ * den Beginn der Nacht und des Tages für die Breitengrade + 66 bis -38 published in Strasbourg, France in 1899.
+ * This calendar was very popular in Europe, and many other calendars based their time on it. Rav Dovid Tzvi Hoffman in his
+ * Sh"Ut Melamed Leho'il in an exchange of letters with Baruch Cohn in Orach Chaim 30 agreed to this zman (page 36),
+ * as did the Sh"Ut Bnei Tziyon and the Tenuvas Sadeh. It is very close to the time of the Mekor Chesed of the Sefer chasidim. It is close to the position of the sun 30 minutes
+ * after sunset in Jerusalem around the equinox / equilux, but not
+ * Exactly. The actual position of the sun 30 minutes after sunset in Jerusalem at the equilux is 7.205° and 7.199°
+ * at the equinox. See Hazmanim Bahalacha vol 2, pages 520-521 for more details.
+ *
+ * @return the Date
representing the time when the sun is 7.083° below sea level. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_7_POINT_083
+ */
+ public func getTzaisGeonim7Point083Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_7_POINT_083);
+ }
+
+ /**
+ * This method returns tzais (nightfall) based on the opinion of the Geonim calculated as 45 minutes
+ * after sunset during the summer solstice in New York, when the neshef (twilight) is the longest. The sun's
+ * position at this time computes to {@link #ZENITH_7_POINT_67 7.75°} below the western horizon. See Igros Moshe Even Haezer 4, Ch. 4 (regarding
+ * tzais for krias Shema). It is also mentioned in Rabbi Heber's Shaarei Zmanim on in
+ * chapter 10 (page 87) and
+ * chapter 12 (page 108). Also see the
+ * time of 45 minutes in Rabbi Simcha Bunim Cohen's The radiance of Shabbos as the earliest zman for New York.
+ * This zman is also listed in the Divrei
+ * Shalom Vol. III, chapter 75, and Bais Av"i
+ * Vol. III, chapter 117. This zman is also listed in the Divrei Shalom etc. chapter 177 (FIXME - could not
+ * be located). Since this zman depends on the level of light, Rabbi Yaakov Shakow presented this degree-based
+ * calculation to Rabbi Rabbi Shmuel Kamenetsky who agreed
+ * to it.
+ * @todo add hyperlinks to source of Divrei Shalom once it is located.
+ * @return the Date
representing the time when the sun is 7.67° below sea level. If the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
+ * north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
+ * calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_7_POINT_67
+ */
+ public func getTzaisGeonim7Point67Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_7_POINT_67);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated at the
+ * sun's position at {@link #ZENITH_8_POINT_5 8.5°} below the western horizon.
+ *
+ * @return the Date
representing the time when the sun is 8.5° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #ZENITH_8_POINT_5
+ */
+ public func getTzaisGeonim8Point5Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_8_POINT_5);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the calculations used in the Luach Itim Lebinah as the stringent time for tzais. It is
+ * calculated at the sun's position at {@link #ZENITH_9_POINT_3 9.3°} below the western horizon.
+ *
+ * @return the Date
representing the time when the sun is 9.3° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ */
+ public func getTzaisGeonim9Point3Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_9_POINT_3);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Geonim calculated as 60
+ * minutes after sunset around the equinox / equilux, the
+ * day that a solar hour is 60 minutes in New York. The sun's position at this time computes to
+ * {@link #ZENITH_9_POINT_75 9.75°} below the western horizon. This is the opinion of Rabbi Eliyahu Henkin. This also follows the opinion of
+ * Rabbi Shmuel Kamenetsky. Rabbi Yaakov Shakow presented
+ * these degree-based times to Rabbi Shmuel Kamenetsky who agreed to them.
+ *
+ * @todo recalculate based on equinox / equilux.
+ * @return the Date
representing the time when the sun is 9.75° below sea level. If the calculation
+ * can't be computed such as northern and southern locations even south of the Arctic Circle and north of
+ * the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ *
+ * @see #getTzais60()
+ */
+ public func getTzaisGeonim9Point75Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_9_POINT_75);
+ }
+
+ /**
+ * This method returns the tzais (nightfall) based on the opinion of the Chavas Yair and Divrei Malkiel that the time to walk the distance of a Mil is 15 minutes for a total of 60 minutes
+ * for 4 Mil after {@link #getSeaLevelSunset() sea level sunset}. See detailed documentation explaining the
+ * 60 minute concept at {@link #getAlos60()}.
+ *
+ * @return the Date
representing 60 minutes after sea level sunset. If the calculation can't be
+ * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
+ * and one where it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getAlos60()
+ * @see #getPlagHamincha60Minutes()
+ * @see #getShaahZmanis60Minutes()
+ */
+ public func getTzais60() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 60 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method returns tzais usually calculated as 40 minutes (configurable to any offset via
+ * {@link #setAteretTorahSunsetOffset(double)}) after sunset. Please note that Chacham Yosef Harari-Raful
+ * of Yeshivat Ateret Torah who uses this time, does so only for calculating various other zmanai hayom
+ * such as Sof Zman Krias Shema and Plag Hamincha. His calendars do not publish a zman
+ * for Tzais. It should also be noted that Chacham Harari-Raful provided a 25 minute zman
+ * for Israel. This API uses 40 minutes year round in any place on the globe by default. This offset can be change
+ * by calling {@link #setAteretTorahSunsetOffset(double)}.
+ *
+ * @return the Date
representing 40 minutes (configurable via {@link #setAteretTorahSunsetOffset})
+ * after sea level sunset. If the calculation can't be computed such as in the Arctic Circle where there is
+ * at least one day a year where the sun does not rise, and one where it does not set, a nil
will
+ * be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAteretTorahSunsetOffset()
+ * @see #setAteretTorahSunsetOffset(double)
+ */
+ public func getTzaisAteretTorah() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: getAteretTorahSunsetOffset() * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Returns the offset in minutes after sunset used to calculate tzais based on the calculations of
+ * Chacham Yosef Harari-Raful of Yeshivat Ateret Torah calculations. The default value is 40 minutes.
+ * This affects most zmanim, since almost all zmanim use subset as part of their calculation.
+ *
+ * @return the number of minutes after sunset for Tzait.
+ * @see #setAteretTorahSunsetOffset(double)
+ */
+ public func getAteretTorahSunsetOffset() -> Double {
+ return ateretTorahSunsetOffset;
+ }
+
+ /**
+ * Allows setting the offset in minutes after sunset for the Ateret Torah zmanim. The default if unset is
+ * 40 minutes. Chacham Yosef Harari-Raful of Yeshivat Ateret Torah uses 40 minutes globally with the exception
+ * of Israel where a 25 minute offset is used. This 40 minute (or any other) offset can be overridden by this method.
+ * This offset impacts all Ateret Torah zmanim.
+ *
+ * @param ateretTorahSunsetOffset
+ * the number of minutes after sunset to use as an offset for the Ateret Torah tzais
+ * @see #getAteretTorahSunsetOffset()
+ */
+ public func setAteretTorahSunsetOffset(ateretTorahSunsetOffset:Double) {
+ self.ateretTorahSunsetOffset = ateretTorahSunsetOffset;
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning) based on the
+ * calculation of Chacham Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
+ * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
+ * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
+ * {@link #setAteretTorahSunsetOffset(double)}). shaos zmaniyos are calculated based on this day and added
+ * to {@link #getAlos72Zmanis() alos} to reach this time. This time is 3
+ * {@link #getShaahZmanisAteretTorah() shaos zmaniyos} (temporal hours) after
+ * {@link #getAlos72Zmanis() alos 72 zmaniyos}. Note: Based on this calculation chatzos
+ * will not be at midday.
+ *
+ * @return the Date
of the latest zman krias shema based on this calculation. If the
+ * calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
+ * the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getAteretTorahSunsetOffset()
+ * @see #setAteretTorahSunsetOffset(double)
+ * @see #getShaahZmanisAteretTorah()
+ */
+ public func getSofZmanShmaAteretTorah() -> Date? {
+ return getSofZmanShma(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) based on the calculation
+ * of Chacham Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis()
+ * 1/10th of the day} before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes
+ * after sunset} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). shaos zmaniyos
+ * are calculated based on this day and added to {@link #getAlos72Zmanis() alos} to reach this time. This time
+ * is 4 * {@link #getShaahZmanisAteretTorah() shaos zmaniyos} (temporal hours) after
+ * {@link #getAlos72Zmanis() alos 72 zmaniyos}.
+ * Note: Based on this calculation chatzos will not be at midday.
+ *
+ * @return the Date
of the latest zman krias shema based on this calculation. If the
+ * calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
+ * the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getShaahZmanisAteretTorah()
+ * @see #setAteretTorahSunsetOffset(double)
+ */
+ public func getSofZmanTfilaAteretTorah() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * @see #getSofZmanTfilaAteretTorah()
+ * //@Deprecated misspelled method name (all other methods spell tfila witout an H) to be removed in 3.0.0.
+ * @return the Date
of the latest zman krias shema based on this calculation. If the
+ * calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
+ * the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getSofZmanTfilahAteretTorah() -> Date? {
+ return getSofZmanTfila(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * This method returns the time of mincha gedola based on the calculation of Chacham Yosef
+ * Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day}
+ * before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset}
+ * (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest
+ * time to pray mincha according to the opinion of the Rambam and others. For more information on this see the documentation on {@link #getMinchaGedola() mincha
+ * gedola}. This is calculated as 6.5 {@link #getShaahZmanisAteretTorah() solar hours} after alos. The
+ * calculation used is 6.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() alos}.
+ *
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getShaahZmanisAteretTorah()
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetanaAteretTorah()
+ * @see ZmanimCalendar#getMinchaGedola()
+ * @see #getAteretTorahSunsetOffset()
+ * @see #setAteretTorahSunsetOffset(double)
+ *
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaGedolaAteretTorah() -> Date? {
+ return getMinchaGedola(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * This method returns the time of mincha ketana based on the calculation of
+ * Chacham Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
+ * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
+ * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
+ * {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest time to pray mincha
+ * according to the opinion of the Rambam and others.
+ * For more information on this see the documentation on {@link #getMinchaGedola() mincha gedola}. This is
+ * calculated as 9.5 {@link #getShaahZmanisAteretTorah() solar hours} after {@link #getAlos72Zmanis() alos}.
+ * The calculation used is 9.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() alos}.
+ *
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getShaahZmanisAteretTorah()
+ * @see #getAteretTorahSunsetOffset()
+ * @see #setAteretTorahSunsetOffset(double)
+ * @see #getMinchaGedola()
+ * @see #getMinchaKetana()
+ * @return the Date
of the time of mincha ketana. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaKetanaAteretTorah() -> Date? {
+ return getMinchaKetana(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * This method returns the time of plag hamincha based on the calculation of Chacham Yosef Harari-Raful
+ * of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is
+ * usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset
+ * via {@link #setAteretTorahSunsetOffset(double)}). shaos zmaniyos are calculated based on this day and
+ * added to {@link #getAlos72Zmanis() alos} to reach this time. This time is 10.75
+ * {@link #getShaahZmanisAteretTorah() shaos zmaniyos} (temporal hours) after {@link #getAlos72Zmanis()
+ * dawn}.
+ *
+ * @return the Date
of the plag. If the calculation can't be computed such as in the Arctic Circle
+ * where there is at least one day a year where the sun does not rise, and one where it does not set, a nil
+ * will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72Zmanis()
+ * @see #getTzaisAteretTorah()
+ * @see #getShaahZmanisAteretTorah()
+ * @see #setAteretTorahSunsetOffset(double)
+ * @see #getAteretTorahSunsetOffset()
+ */
+ public func getPlagHaminchaAteretTorah() -> Date? {
+ return getPlagHamincha(startOfDay: getAlos72Zmanis(), endOfDay: getTzaisAteretTorah(), synchronous: false);
+ }
+
+ /**
+ * Method to return tzais (dusk) calculated as 72 minutes zmaniyos, or 1/10th of the day after
+ * {@link #getSeaLevelSunset() sea level sunset}. This is the way that the Minchas Cohen in Ma'amar 2:4 calculates Rebbeinu Tam's
+ * time of tzeis. It should be noted that this calculation results in the shortest time from sunset to
+ * tzais being during the winter solstice, the longest at the summer solstice and 72 clock minutes at the
+ * equinox. This does not match reality, since there is no direct relationship between the length of the day and
+ * twilight. The shortest twilight is during the equinox, the longest is during the the summer solstice, and in the
+ * winter with the shortest daylight, the twilight period is longer than during the equinoxes.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos72Zmanis()
+ */
+ public func getTzais72Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: 1.2);
+ }
+
+ /**
+ * A utility method to return alos (dawn) or tzais (dusk) based on a fractional day offset.
+ * @param hours the number of shaaos zmaniyos (temporal hours) before sunrise or after sunset that defines dawn
+ * or dusk. If a negative number is passed in, it will return the time of alos (dawn) (subtracting the
+ * time from sunrise) and if a positive number is passed in, it will return the time of tzais (dusk)
+ * (adding the time to sunset). If 0 is passed in, a nil
will be returned (since we can't tell if it
+ * is sunrise or sunset based).
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. A nil
will also be returned if 0 is passed in, since we can't
+ * tell if it is sunrise or sunset based. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ */
+ private func getZmanisBasedOffset(hours:Double) -> Date? {
+ let shaahZmanis = getShaahZmanisGra();
+ if (shaahZmanis == Int64.min || hours == 0) {
+ return nil;
+ }
+
+ if (hours > 0) {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: Double(shaahZmanis) * hours);
+ } else {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunrise(), offset: Double(shaahZmanis) * hours);
+ }
+ }
+
+ /**
+ * Method to return tzais (dusk) calculated using 90 minutes zmaniyos or 1/8th of the day after {@link
+ * #getSeaLevelSunset() sea level sunset}. This time is known in Yiddish as the achtel (an eighth)
+ * zman.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos90Zmanis()
+ */
+ public func getTzais90Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: 1.5);
+ }
+
+ /**
+ * Method to return tzais (dusk) calculated using 96 minutes zmaniyos or 1/7.5 of the day after
+ * {@link #getSeaLevelSunset() sea level sunset}.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos96Zmanis()
+ */
+ public func getTzais96Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: 1.6);
+ }
+
+ /**
+ * Method to return tzais (dusk) calculated as 90 minutes after sea level sunset. This method returns
+ * tzais (nightfall) based on the opinion of the Magen Avraham that the time to walk the distance of a
+ * Mil according to the Rambam's opinion
+ * is 18 minutes for a total of 90 minutes based on the opinion of Ula who calculated tzais as 5
+ * Mil after sea level shkiah (sunset). A similar calculation {@link #getTzais19Point8Degrees()}
+ * uses solar position calculations based on this time.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getTzais19Point8Degrees()
+ * @see #getAlos90()
+ */
+ public func getTzais90() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 90 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method should be used lechumra only and returns tzais (nightfall) based on the calculations
+ * of Rav Chaim Naeh that the time to walk the
+ * distance of a Mil according to the Rambam's opinion
+ * is 2/5 of an hour (24 minutes) for a total of 120 minutes based on the opinion of Ula who calculated
+ * tzais as 5 Mil after sea level shkiah (sunset). A similar calculation {@link
+ * #getTzais26Degrees()} uses degree-based calculations based on this 120 minute calculation. Since the zman
+ * is extremely late and at a point that is long past the 18° point where the darkest point is
+ * reached, it should only be used lechumra, such as delaying the start of nighttime mitzvos.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time, and if used
+ * lekula can result in chillul Shabbos etc. There is no current plan to remove this
+ * method from the API, and this deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
+ * documentation.
+ * @see #getTzais26Degrees()
+ * @see #getAlos120()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getTzais120() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 120 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method should be used lechumra only and returns tzais (dusk) calculated using 120 minutes
+ * zmaniyos after {@link #getSeaLevelSunset() sea level sunset}. Since the zman
+ * is extremely late and at a point when the it is long past the 18° point where the darkest point is
+ * reached, it should only be used lechumra, such as delaying the start of nighttime mitzvos.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time, and if used
+ * lekula can result in chillul Shabbos etc. There is no current plan to remove this
+ * method from the API, and this deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos120Zmanis()
+ * @see #getTzais120()
+ * @see #getTzais26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getTzais120Zmanis() -> Date? {
+ return getZmanisBasedOffset(hours: 2.0);
+ }
+
+ /**
+ * This calculates the time of tzais at the point when the sun is 16.1° below the horizon. This is
+ * the sun's dip below the horizon 72 minutes after sunset according Rabbeinu Tam's calculation of tzais
+ * around the equinox / equilux in
+ * Jerusalem. The question of equinox VS equilux is complex, with Rabbi Meir Posen in the Ohr Meir of the opinion that the equilux should be used. See
+ * Yisrael Vehazmanim vol I, 34:1:4. Rabbi Yedidya Manet in his Zmanei Halacha Lema'aseh (4th edition part 2, pages
+ * and 22 and 24) and Rabbi Yonah Metzbuch (in a letter published by Rabbi Manet) are of the opinion that the
+ * astronomical equinox should be used. The difference adds up to about 9 seconds, too trivial to make much of a
+ * difference. For information on how this is calculated see the comments on {@link #getAlos16Point1Degrees()}.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
+ * not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getTzais72()
+ * @see #getAlos16Point1Degrees() for more information on this calculation.
+ */
+ public func getTzais16Point1Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_16_POINT_1);
+ }
+
+ /**
+ * This method should be used lechumra only and returns tzais based on when the sun is 26°
+ * below the horizon.For information on how this is calculated see the comments on {@link #getAlos26Degrees()}.
+ * Since the zman is extremely late and at a point when it is long past the 18° point where the
+ * darkest point is reached, it should only be used lechumra such as delaying the start of nighttime
+ * mitzvos.
+ *
+ * //@Deprecated This method should be used lechumra only since it returns a very late time, and if used
+ * lekula can result in chillul Shabbos etc. There is no current plan to remove this
+ * method from the API, and this deprecation is intended to alert developers of the danger of using it.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
+ * not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getTzais120()
+ * @see #getAlos26Degrees()
+ */
+ ////@Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
+ public func getTzais26Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_26_DEGREES);
+ }
+
+ /**
+ * For information on how this is calculated see the comments on {@link #getAlos18Degrees()}
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
+ * not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos18Degrees()
+ */
+ public func getTzais18Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ASTRONOMICAL_ZENITH);
+ }
+
+ /**
+ * For information on how this is calculated see the comments on {@link #getAlos19Point8Degrees()}
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as northern and
+ * southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
+ * not reach low enough below the horizon for this calculation, a nil
will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getTzais90()
+ * @see #getAlos19Point8Degrees()
+ */
+ public func getTzais19Point8Degrees() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_19_POINT_8);
+ }
+
+ /**
+ * A method to return tzais (dusk) calculated as 96 minutes after sea level sunset. For information on how
+ * this is calculated see the comments on {@link #getAlos96()}.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ * @see #getAlos96()
+ */
+ public func getTzais96() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 96 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * A method that returns the local time for fixed chatzos. This time is noon and midnight adjusted from
+ * standard time to account for the local latitude. The 360° of the globe divided by 24 calculates to 15°
+ * per hour with 4 minutes per degree, so at a longitude of 0 , 15, 30 etc... Chatzos is at exactly 12:00
+ * noon. This is the time of chatzos according to the Aruch Hashulchan in Orach Chaim 233:14 and Rabbi Moshe Feinstein in Igros Moshe Orach Chaim 1:24 and 2:20.
+ * Lakewood, N.J., with a longitude of -74.222, is 0.778 away from the closest multiple of 15 at -75°. This
+ * is multiplied by 4 to yield 3 minutes and 7 seconds for a chatzos of 11:56:53. This method is not tied
+ * to the theoretical 15° timezones, but will adjust to the actual timezone and Daylight saving time.
+ *
+ * @return the Date representing the local chatzos
+ * @see GeoLocation#getLocalMeanTimeOffset()
+ * @see AstronomicalCalendar#getLocalMeanTime(double)
+ */
+ public func getFixedLocalChatzos() -> Date? {
+ return getLocalMeanTime(hours: 12.0);
+ }
+
+ /**
+ * A method that returns the latest zman krias shema (time to recite Shema in the morning) calculated as 3
+ * clock hours before {@link #getFixedLocalChatzos()}. Note that there are opinions brought down in Yisrael Vehazmanim
+ * page 57 and Rav Yitzchak Silber's Sha'aos Shavos Balalacha that this calculation is a mistake and regular
+ * chatzos shoud be used for clock-hour calculations as opposed to fixed local chatzos. According to
+ * these opinions it should be 3 clock hours before regular chatzos as calculated in {@link
+ * #getSofZmanShma3HoursBeforeChatzos()}.
+ *
+ * @return the Date
of the latest zman krias shema calculated as 3 clock hours before
+ * {@link #getFixedLocalChatzos()}.
+ * @see #getFixedLocalChatzos()
+ * @see #getSofZmanShma3HoursBeforeChatzos()
+ * @see #getSofZmanTfilaFixedLocal()
+ *
+ * //@Deprecated This method of calculating sof zman Shma is considered a mistaken understanding of the proper
+ * calculation of this zman in the opinion of Rav Yitzchak Silber's Sha'aos Shavos Balalacha. On pages 316-318 he discusses Rav Yisrael
+ * Harfenes's calculations and points to his seeming agreement that using fixed local chatzos as the focal
+ * point is problematic. See Yisrael Vehazmanim page 57. While the Yisrael Vehazmanim mentions
+ * this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the sefer.
+ * A competent rabbinical authority should be consulted before using this zman. Instead, the use of {@link
+ * #getSofZmanShma3HoursBeforeChatzos()} should be used to calculate sof zman Tfila using 3 fixed clock hours.
+ * This will likely be removed in v3.0.
+ */
+ ////@Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getSofZmanShmaFixedLocal() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getFixedLocalChatzos(), offset: -180 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * This method returns the latest zman tfila (time to recite the morning prayers) calculated as 2 hours
+ * before {@link #getFixedLocalChatzos()}. See the documentation on {@link #getSofZmanShmaFixedLocal()} showing
+ * differing opinions on how the zman is calculated. According to many opinions {@link
+ * #getSofZmanTfila2HoursBeforeChatzos()} should be used as opposed to this zman.
+ *
+ * @return the Date
of the latest zman tfila.
+ * @see #getFixedLocalChatzos()
+ * @see #getSofZmanShmaFixedLocal()
+ * @see #getSofZmanTfila2HoursBeforeChatzos()
+ *
+ * //@Deprecated This method of calculating sof zman Tfila is considered a mistaken understanding of the proper
+ * calculation of this zman in the opinion of Rav Yitzchak Silber's Sha'aos Shavos Balalacha. On pages 316-318 he discusses Rav Yisrael
+ * Harfenes's calculations and points to his seeming agreement that using fixed local chatzos as the focal
+ * point is problematic. See Yisrael Vehazmanim page 57. While the Yisrael Vehazmanim mentions
+ * this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the sefer.
+ * A competent rabbinical authority should be consulted before using this zman. Instead, the use of {@link
+ * #getSofZmanTfila2HoursBeforeChatzos()} should be used to calculate sof zman Tfila using 2 fixed
+ * clock hours. This will likely be removed in v3.0.
+ */
+ ////@Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getSofZmanTfilaFixedLocal() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getFixedLocalChatzos(), offset: -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * Returns the latest time of Kidush Levana according to the Maharil's opinion that it is calculated as
+ * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time
+ * between molad and molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad.
+ * If the time of sof zman Kiddush Levana occurs during the day (between the alos and tzais passed in
+ * as parameters), it returns the alos passed in. If a nil
alos or tzais are passed to
+ * this method, the non-daytime adjusted time will be returned.
+ *
+ * @param alos
+ * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at alos and
+ * ending at tzais), the time returned will be alos. If either the alos or tzais
+ * parameters are nil, no daytime adjustment will be made.
+ * @param tzais
+ * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
+ * tzais), the time returned will be alos. If either the alos or tzais parameter
+ * are nil, no daytime adjustment will be made.
+ * @return the Date representing the moment halfway between molad and molad. If the time occurs between
+ * alos and tzais, alos will be returned. If the zman will not occur on this day, a
+ * nil
will be returned.
+ * @see #getSofZmanKidushLevanaBetweenMoldos()
+ * @see #getSofZmanKidushLevana15Days(Date, Date)
+ * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
+ */
+ public func getSofZmanKidushLevanaBetweenMoldos(alos:Date?, tzais:Date?) -> Date? {
+ let jewishCalendar = JewishCalendar();
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ jewishCalendar.setGregorianDate(year: gregorianCalendar.component(.year, from: workingDate), month: gregorianCalendar.component(.month, from: workingDate), dayOfMonth: gregorianCalendar.component(.day, from: workingDate));
+
+ // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
+ // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on Rosh Chodesh, the sof zman Kiddush Levana
+ // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the
+ // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
+ if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 16) {
+ return nil;
+ }
+ return getMoladBasedTime(moladBasedTime: jewishCalendar.getSofZmanKidushLevanaBetweenMoldos(), alos: alos, tzais: tzais, techila: false);
+ }
+
+ /**
+ * Returns the Date of the molad based time if it occurs on the current date. Since Kiddush Levana
+ * can only be said during the day, there are parameters to limit it to between alos and tzais. If
+ * the time occurs between alos and tzais, tzais will be returned.
+ *
+ * @param moladBasedTime
+ * the molad based time such as molad, tchilas and sof zman Kiddush Levana
+ * @param alos
+ * optional start of day to limit molad times to the end of the night before or beginning of the next night.
+ * Ignored if either alos or tzais are nil.
+ * @param tzais
+ * optional end of day to limit molad times to the end of the night before or beginning of the next night.
+ * Ignored if either tzais or alos are nil
+ * @param techila
+ * is it the start of Kiddush Levana time or the end? If it is start roll it to the next tzais, and
+ * and if it is the end, return the end of the previous night (alos passed in). Ignored if either
+ * alos or tzais are nil.
+ * @return the molad based time. If the zman does not occur during the current date, nil
will be
+ * returned.
+ */
+ private func getMoladBasedTime(moladBasedTime:Date, alos:Date?, tzais:Date?, techila:Bool) -> Date? {
+ let lastMidnight = getMidnightLastNight();
+ let midnightTonight = getMidnightTonight();
+ if (!(moladBasedTime.compare(lastMidnight) == .orderedAscending || moladBasedTime.compare(midnightTonight) == .orderedDescending)){
+ if (alos != nil || tzais != nil) {
+ if (techila && !(moladBasedTime.compare(tzais!) == .orderedAscending || moladBasedTime.compare(alos!) == .orderedDescending)){
+ return tzais;
+ } else {
+ return alos;
+ }
+ }
+ return moladBasedTime;
+ }
+ return nil;
+ }
+
+ /**
+ * Returns the latest time of Kiddush Levana according to the Maharil's opinion that it is calculated as
+ * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between
+ * molad and molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad.
+ * The sof zman Kiddush Levana will be returned even if it occurs during the day. To limit the time to between
+ * tzais and alos, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
+ *
+ * @return the Date representing the moment halfway between molad and molad. If the time occurs between
+ * alos and tzais, alos will be returned. If the zman will not occur on this
+ * day, a nil
will be returned.
+ * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
+ * @see #getSofZmanKidushLevana15Days()
+ * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
+ */
+ public func getSofZmanKidushLevanaBetweenMoldos() -> Date? {
+ return getSofZmanKidushLevanaBetweenMoldos(alos: nil, tzais: nil);
+ }
+
+ /**
+ * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the
+ * opinion brought down in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
+ * Rema who brings down the opinion of the Maharil's of calculating
+ * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between molad and molad} is of
+ * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
+ * see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of Shaarei Zmanim. If the time of sof zman Kiddush Levana occurs during
+ * the day (between the alos and tzais passed in as parameters), it returns the alos passed in. If a
+ * nil alos or tzais are passed to this method, the non-daytime adjusted time will be returned.
+ *
+ * @param alos
+ * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at alos and
+ * ending at tzais), the time returned will be alos. If either the alos or tzais
+ * parameters are nil, no daytime adjustment will be made.
+ * @param tzais
+ * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
+ * tzais), the time returned will be alos. If either the alos or tzais parameters
+ * are nil, no daytime adjustment will be made.
+ *
+ * @return the Date representing the moment 15 days after the molad. If the time occurs between alos and
+ * tzais, alos will be returned. If the zman will not occur on this day, a
+ * nil
will be returned.
+ *
+ * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
+ * @see JewishCalendar#getSofZmanKidushLevana15Days()
+ */
+ public func getSofZmanKidushLevana15Days(alos:Date?, tzais:Date?) -> Date? {
+ let jewishCalendar = JewishCalendar();
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ jewishCalendar.setGregorianDate(year: gregorianCalendar.component(.year, from: workingDate), month: gregorianCalendar.component(.month, from: workingDate), dayOfMonth: gregorianCalendar.component(.day, from: workingDate));
+ // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
+ // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on Rosh Chodesh, the sof zman Kiddush
+ // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will
+ // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
+ if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 17) {
+ return nil;
+ }
+ return getMoladBasedTime(moladBasedTime: jewishCalendar.getSofZmanKidushLevana15Days(), alos: alos, tzais: tzais, techila: false);
+ }
+
+ /**
+ * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion of
+ * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
+ * Rema who brings down the opinion of the Maharil's of calculating
+ * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between molad and molad} is of
+ * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
+ * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of Shaarei
+ * Zmanim. The sof zman Kiddush Levana will be returned even if it occurs during the day. To limit the time to
+ * between tzais and alos, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
+ *
+ * @return the Date representing the moment 15 days after the molad. If the time occurs between
+ * alos and tzais, alos will be returned. If the zman will not occur on this day, a
+ * nil
will be returned.
+ *
+ * @see #getSofZmanKidushLevana15Days(Date, Date)
+ * @see #getSofZmanKidushLevanaBetweenMoldos()
+ * @see JewishCalendar#getSofZmanKidushLevana15Days()
+ *
+ */
+ public func getSofZmanKidushLevana15Days() -> Date? {
+ return getSofZmanKidushLevana15Days(alos: nil, tzais: nil);
+ }
+
+ /**
+ * Returns the earliest time of Kiddush Levana according to Rabbeinu Yonah's opinion that it can be said 3 days after the
+ * molad. The time will be returned even if it occurs during the day when Kiddush Levana can't be said.
+ * Use {@link #getTchilasZmanKidushLevana3Days(Date, Date)} if you want to limit the time to night hours.
+ *
+ * @return the Date representing the moment 3 days after the molad. If the zman will not occur on this day, a
+ * nil
will be returned.
+ * @see #getTchilasZmanKidushLevana3Days(Date, Date)
+ * @see #getTchilasZmanKidushLevana7Days()
+ * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
+ */
+ public func getTchilasZmanKidushLevana3Days() -> Date? {
+ return getTchilasZmanKidushLevana3Days(alos: nil, tzais: nil);
+ }
+
+ /**
+ * Returns the earliest time of Kiddush Levana according to Rabbeinu Yonah's opinion that it can be said 3 days after the molad.
+ * If the time of tchilas zman Kiddush Levana occurs during the day (between alos and tzais passed to
+ * this method) it will return the following tzais. If nil is passed for either alos or tzais, the actual
+ * tchilas zman Kiddush Levana will be returned, regardless of if it is during the day or not.
+ *
+ * @param alos
+ * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending
+ * at tzais), the time returned will be tzais. If either the alos or tzais parameters
+ * are nil, no daytime adjustment will be made.
+ * @param tzais
+ * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
+ * tzais), the time returned will be tzais. If either the alos or tzais parameters
+ * are nil, no daytime adjustment will be made.
+ *
+ * @return the Date representing the moment 3 days after the molad. If the time occurs between alos and
+ * tzais, tzais will be returned. If the zman will not occur on this day, a
+ * nil
will be returned.
+ * @see #getTchilasZmanKidushLevana3Days()
+ * @see #getTchilasZmanKidushLevana7Days(Date, Date)
+ * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
+ */
+ public func getTchilasZmanKidushLevana3Days(alos:Date?, tzais:Date?) -> Date? {
+ let jewishCalendar = JewishCalendar();
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ jewishCalendar.setGregorianDate(year: gregorianCalendar.component(.year, from: workingDate), month: gregorianCalendar.component(.month, from: workingDate), dayOfMonth: gregorianCalendar.component(.day, from: workingDate));
+
+ // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for
+ // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening
+ // of the 30th, the second night of Rosh Chodesh. The 3rd day after the molad will be on the 4th of the month.
+ // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day
+ // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
+ if (jewishCalendar.getJewishDayOfMonth() > 5 && jewishCalendar.getJewishDayOfMonth() < 30) {
+ return nil;
+ }
+
+ var zman = getMoladBasedTime(moladBasedTime: jewishCalendar.getTchilasZmanKidushLevana3Days(), alos: alos, tzais: tzais, techila: true);
+
+ //Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when
+ // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)
+ if (zman == nil && jewishCalendar.getJewishDayOfMonth() == 30) {
+ jewishCalendar.forward()
+ zman = getMoladBasedTime(moladBasedTime: jewishCalendar.getTchilasZmanKidushLevana3Days(), alos: nil, tzais: nil, techila: true);
+ }
+
+ return zman;
+ }
+
+ /**
+ * Returns the point in time of Molad as a Date
Object. For the traditional day of week, hour,
+ * minute and chalakim, {@link JewishCalendar#getMoladAsDate()} and the not yet completed
+ * {@link com.kosherjava.zmanim.hebrewcalendar.HebrewDateFormatter} that will have formatting for this.
+ *
+ * @return the Date representing the moment of the molad. If the molad does not occur on this day, a
+ * nil
will be returned.
+ *
+ * @see #getTchilasZmanKidushLevana3Days()
+ * @see #getTchilasZmanKidushLevana7Days(Date, Date)
+ * @see JewishCalendar#getMoladAsDate()
+ */
+ public func getZmanMolad() -> Date? {
+ let jewishCalendar = JewishCalendar();
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ jewishCalendar.setGregorianDate(year: gregorianCalendar.component(.year, from: workingDate), month: gregorianCalendar.component(.month, from: workingDate), dayOfMonth: gregorianCalendar.component(.day, from: workingDate));
+
+ // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa
+ // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on
+ // Jan 2071, the molad will be on the 2nd day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
+ if (jewishCalendar.getJewishDayOfMonth() > 2 && jewishCalendar.getJewishDayOfMonth() < 27) {
+ return nil;
+ }
+ var molad = getMoladBasedTime(moladBasedTime: jewishCalendar.getMoladAsDate(), alos: nil, tzais: nil, techila: true);
+
+ // deal with molad that happens on the end of the previous month
+ if (molad == nil && jewishCalendar.getJewishDayOfMonth() > 26) {
+ jewishCalendar.forward()
+ molad = getMoladBasedTime(moladBasedTime: jewishCalendar.getMoladAsDate(), alos: nil, tzais: nil, techila: true);
+ }
+ return molad;
+ }
+
+ /**
+ * Used by Molad based zmanim to determine if zmanim occur during the current day.
+ * @see #getMoladBasedTime(Date, Date, Date, boolean)
+ * @return previous midnight
+ */
+ private func getMidnightLastNight() -> Date {
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ let comp = DateComponents(calendar: gregorianCalendar,
+ timeZone: getGeoLocation().getTimeZone(),
+ year: gregorianCalendar.component(.year, from: workingDate),
+ month: gregorianCalendar.component(.month, from: workingDate),
+ day: gregorianCalendar.component(.day, from: workingDate),
+ hour: 0,
+ minute: 0,
+ second: 0)
+ return gregorianCalendar.date(from: comp)!;
+ }
+
+ /**
+ * Used by Molad based zmanim to determine if zmanim occur during the current day.
+ * @see #getMoladBasedTime(Date, Date, Date, boolean)
+ * @return following midnight
+ */
+ private func getMidnightTonight() -> Date {
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ let comp = DateComponents(calendar: gregorianCalendar,
+ timeZone: getGeoLocation().getTimeZone(),
+ year: gregorianCalendar.component(.year, from: workingDate),
+ month: gregorianCalendar.component(.month, from: workingDate),
+ day: gregorianCalendar.component(.day, from: workingDate) + 1,//roll to tonight
+ hour: 0,
+ minute: 0,
+ second: 0)
+ return gregorianCalendar.date(from: comp)!;
+ }
+
+ /**
+ * Returns the earliest time of Kiddush Levana according to the opinions that it should not be said until 7
+ * days after the molad. If the time of tchilas zman Kiddush Levana occurs during the day (between
+ * {@link ZmanimCalendar#getAlos72() alos} and {@link ZmanimCalendar#getTzais72() tzais}) it
+ * return the next tzais.
+ *
+ * @param alos
+ * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at alos
+ * and ending at tzais), the time returned will be tzais. If either the alos or
+ * tzais parameters are nil, no daytime adjustment will be made.
+ * @param tzais
+ * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and
+ * ending at tzais), the time returned will be tzais. If either the alos or
+ * tzais parameters are nil, no daytime adjustment will be made.
+ *
+ * @return the Date representing the moment 7 days after the molad. If the time occurs between alos and
+ * tzais, tzais will be returned. If the zman will not occur on this day, a
+ * nil
will be returned.
+ * @see #getTchilasZmanKidushLevana3Days(Date, Date)
+ * @see #getTchilasZmanKidushLevana7Days()
+ * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
+ */
+ public func getTchilasZmanKidushLevana7Days(alos:Date?, tzais:Date?) -> Date? {
+ let jewishCalendar = JewishCalendar();
+ var gregorianCalendar = Calendar(identifier: .gregorian)
+ gregorianCalendar.timeZone = getGeoLocation().getTimeZone()
+ jewishCalendar.setGregorianDate(year: gregorianCalendar.component(.year, from: workingDate), month: gregorianCalendar.component(.month, from: workingDate), dayOfMonth: gregorianCalendar.component(.day, from: workingDate));
+
+ // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
+ // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening
+ // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.
+ // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day
+ // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
+ if (jewishCalendar.getJewishDayOfMonth() < 4 || jewishCalendar.getJewishDayOfMonth() > 9) {
+ return nil;
+ }
+
+ return getMoladBasedTime(moladBasedTime: jewishCalendar.getTchilasZmanKidushLevana7Days(), alos: alos, tzais: tzais, techila: true);
+ }
+
+ /**
+ * Returns the earliest time of Kiddush Levana according to the opinions that it should not be said until 7
+ * days after the molad. The time will be returned even if it occurs during the day when Kiddush Levana
+ * can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
+ *
+ * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the zman
+ * will not occur on this day, a nil
will be returned.
+ * @see #getTchilasZmanKidushLevana7Days(Date, Date)
+ * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
+ * @see #getTchilasZmanKidushLevana3Days()
+ */
+ public func getTchilasZmanKidushLevana7Days() -> Date? {
+ return getTchilasZmanKidushLevana7Days(alos: nil, tzais: nil);
+ }
+
+ /**
+ * This method returns the latest time one is allowed eating chametz on Erev Pesach according to
+ * the opinion of theGRA. This time is identical to the {@link
+ * #getSofZmanTfilaGRA() Sof zman tfilah GRA} and is provided as a convenience method for those who are
+ * unaware how this zman is calculated. This time is 4 hours into the day based on the opinion of the
+ * GRA that the day is calculated from sunrise to sunset.
+ * This returns the time 4 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea level sunrise}. If it
+ * is not erev Pesach, a nil will be returned.
+ *
+ * @see ZmanimCalendar#getShaahZmanisGra()
+ * @see ZmanimCalendar#getSofZmanTfilaGRA()
+ * @return the Date
one is allowed eating chametz on Erev Pesach. If it is not erev
+ * Pesach or the calculation can't be computed such as in the Arctic Circle where there is at least one
+ * day a year where the sun does not rise, and one where it does not set, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ */
+ public func getSofZmanAchilasChametzGRA() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getSofZmanTfilaGRA();
+ } else {
+ return nil;
+ }*/
+ return getSofZmanTfilaGRA();
+ }
+
+ /**
+ * This method returns the latest time one is allowed eating chametz on Erev Pesach according to the
+ * opinion of the Magen Avraham (MGA) based on alos
+ * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is identical to the
+ * {@link #getSofZmanTfilaMGA72Minutes() Sof zman tfilah MGA 72 minutes}. This time is 4 {@link #getShaahZmanisMGA()
+ * shaos zmaniyos} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of the MGA that the day is
+ * calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link #getTzais72() nightfall} of 72 minutes
+ * after sunset. This returns the time of 4 * {@link #getShaahZmanisMGA()} after {@link #getAlos72() dawn}. If it is not
+ * erev Pesach, a nil will be returned.
+ *
+ * @return the Date
of the latest time of eating chametz. If it is not erev Pesach or the
+ * calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
+ * not rise, and one where it does not set), a nil
will be returned. See detailed explanation on top of
+ * the {@link AstronomicalCalendar} documentation.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @see #getShaahZmanisMGA()
+ * @see #getAlos72()
+ * @see #getSofZmanTfilaMGA72Minutes()
+ */
+ public func getSofZmanAchilasChametzMGA72Minutes() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getSofZmanTfilaMGA72Minutes();
+ } else {
+ return nil;
+ }*/
+ return getSofZmanTfilaMGA72Minutes();
+ }
+
+ /**
+ * This method returns the latest time one is allowed eating chametz on Erev Pesach according to the
+ * opinion of theMagen Avraham (MGA) based on alos
+ * being {@link #getAlos16Point1Degrees() 16.1°} before {@link #getSunrise() sunrise}. This time is 4 {@link
+ * #getShaahZmanis16Point1Degrees() shaos zmaniyos} (solar hours) after {@link #getAlos16Point1Degrees() dawn}
+ * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1°
+ * below sunrise or sunset. This returns the time of 4 {@link #getShaahZmanis16Point1Degrees()} after
+ * {@link #getAlos16Point1Degrees() dawn}. If it is not erev Pesach, a nil will be returned.
+ *
+ * @return the Date
of the latest time of eating chametz. If it is not erev Pesach or the
+ * calculation can't be computed such as northern and southern locations even south of the Arctic Circle and north
+ * of the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
+ * nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getAlos16Point1Degrees()
+ * @see #getSofZmanTfilaMGA16Point1Degrees()
+ */
+ public func getSofZmanAchilasChametzMGA16Point1Degrees() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getSofZmanTfilaMGA16Point1Degrees();
+ } else {
+ return nil;
+ }*/
+ return getSofZmanTfilaMGA16Point1Degrees();
+ }
+
+ /**
+ * FIXME adjust for syncronous
+ * This method returns the latest time for burning chametz on Erev Pesach according to the opinion
+ * of the GRA. This time is 5 hours into the day based on the
+ * opinion of the GRA that the day is calculated from
+ * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea
+ * level sunrise}. If it is not erev Pesach, a nil will be returned.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @see ZmanimCalendar#getShaahZmanisGra()
+ * @return the Date
of the latest time for burning chametz on Erev Pesach. If it is not
+ * erev Pesach or the calculation can't be computed such as in the Arctic Circle where there is at least
+ * one day a year where the sun does not rise, and one where it does not set, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSofZmanBiurChametzGRA() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getTimeOffset(getElevationAdjustedSunrise(), getShaahZmanisGra() * 5);
+ } else {
+ return nil;
+ }*/
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunrise(), offset: getShaahZmanisGra() * 5);
+ }
+
+ /**
+ * FIXME adjust for syncronous
+ * This method returns the latest time for burning chametz on Erev Pesach according to the opinion of
+ * the Magen Avraham (MGA) based on alos
+ * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 5 {@link
+ * #getShaahZmanisMGA() shaos zmaniyos} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of
+ * the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link
+ * #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 5 * {@link #getShaahZmanisMGA()} after
+ * {@link #getAlos72() dawn}. If it is not erev Pesach, a nil will be returned.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @return the Date
of the latest time for burning chametz on Erev Pesach. If it is not
+ * erev Pesach or the calculation can't be computed such as in the Arctic Circle where there is at
+ * least one day a year where the sun does not rise, and one where it does not set), a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getShaahZmanisMGA()
+ * @see #getAlos72()
+ */
+ public func getSofZmanBiurChametzMGA72Minutes() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getTimeOffset(getAlos72(), getShaahZmanisMGA() * 5);
+ } else {
+ return nil;
+ }*/
+ return ComplexZmanimCalendar.getTimeOffset(time: getAlos72(), offset: getShaahZmanisMGA() * 5);
+ }
+
+ /**
+ * FIXME adjust for syncronous
+ * This method returns the latest time for burning chametz on Erev Pesach according to the opinion
+ * of the Magen Avraham (MGA) based on alos
+ * being {@link #getAlos16Point1Degrees() 16.1°} before {@link #getSunrise() sunrise}. This time is 5
+ * {@link #getShaahZmanis16Point1Degrees() shaos zmaniyos} (solar hours) after {@link #getAlos16Point1Degrees()
+ * dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1°
+ * below sunrise or sunset. This returns the time of 5 {@link #getShaahZmanis16Point1Degrees()} after
+ * {@link #getAlos16Point1Degrees() dawn}. If it is not erev Pesach, a nil will be returned.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @return the Date
of the latest time for burning chametz on Erev Pesach. If it is not
+ * erev Pesach or the calculation can't be computed such as northern and southern locations even south
+ * of the Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the
+ * horizon for this calculation, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @see #getAlos16Point1Degrees()
+ */
+ public func getSofZmanBiurChametzMGA16Point1Degrees() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getTimeOffset(getAlos16Point1Degrees(), getShaahZmanis16Point1Degrees() * 5);
+ } else {
+ return nil;
+ }*/
+ return ComplexZmanimCalendar.getTimeOffset(time: getAlos16Point1Degrees(), offset: getShaahZmanis16Point1Degrees() * 5);
+ }
+
+ /**
+ * A method that returns the Baal Hatanya's
+ * netz amiti (sunrise) without {@link AstronomicalCalculator#getElevationAdjustment(double)
+ * elevation adjustment}. This forms the base for the Baal Hatanya's dawn-based calculations that are
+ * calculated as a dip below the horizon before sunrise.
+ *
+ * According to the Baal Hatanya, netz amiti, or true (halachic) sunrise, is when the top of the sun's
+ * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
+ * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom
+ * DovBer Levine's commentary on The Baal
+ * Hatanya's Seder Hachnasas Shabbos. From an elevation of 546 meters, the top of Har Hacarmel, the sun disappears when it is 1° 35' or 1.583°
+ * below the sea level horizon. This in turn is based on the Gemara Shabbos 35a. There are other opinions brought down by
+ * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
+ * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' zman
+ * and is probably a typo and should be 1.683°. These calculations are used by most Chabad calendars that use the Baal Hatanya's zmanim. See
+ * About Our
+ * Zmanim Calculations @ Chabad.org.
+ *
+ * Note: netz amiti is used only for calculating certain zmanim, and is intentionally unpublished. For
+ * practical purposes, daytime mitzvos like shofar and lulav should not be done until after the
+ * published time for netz / sunrise.
+ *
+ * @return the Date
representing the exact sea-level netz amiti (sunrise) time. If the calculation can't be
+ * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
+ * where it does not set, a nil
will be returned. See detailed explanation on top of the page.
+ *
+ * @see #getSunrise()
+ * @see #getSeaLevelSunrise()
+ * @see #getSunsetBaalHatanya()
+ * @see #ZENITH_1_POINT_583
+ */
+ private func getSunriseBaalHatanya() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_1_POINT_583);
+ }
+
+ /**
+ * A method that returns the Baal Hatanya's
+ * shkiah amiti (sunset) without {@link AstronomicalCalculator#getElevationAdjustment(double)
+ * elevation adjustment}. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
+ * as a dip below the horizon after sunset.
+ *
+ * According to the Baal Hatanya, shkiah amiti, true (halachic) sunset, is when the top of the
+ * sun's disk disappears from view at an elevation similar to the mountains of Eretz Yisrael.
+ * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
+ *
+ * Note: shkiah amiti is used only for calculating certain zmanim, and is intentionally unpublished. For
+ * practical purposes, all daytime mitzvos should be completed before the published time for shkiah / sunset.
+ *
+ * For further explanation of the calculations used for the Baal Hatanya's zmanim in this library, see
+ * About Our
+ * Zmanim Calculations @ Chabad.org.
+ *
+ * @return the Date
representing the exact sea-level shkiah amiti (sunset) time. If the calculation
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
+ * rise, and one where it does not set, a nil
will be returned. See detailed explanation on top of
+ * the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getSunset()
+ * @see #getSeaLevelSunset()
+ * @see #getSunriseBaalHatanya()
+ * @see #ZENITH_1_POINT_583
+ */
+ private func getSunsetBaalHatanya() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_1_POINT_583);
+ }
+
+ /**
+ * A method that returns the Baal Hatanya's
+ * a shaah zmanis ({@link #getTemporalHour(Date, Date) temporal hour}). This forms the base for the
+ * Baal Hatanya's day based calculations that are calculated as a 1.583° dip below the horizon after sunset.
+ * According to the Baal Hatanya, shkiah amiti, true (halachic) sunset, is when the top of the
+ * sun's disk disappears from view at an elevation similar to the mountains of Eretz Yisrael.
+ * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
+ * A method that returns a shaah zmanis ({@link #getTemporalHour(Date, Date) temporal hour}) calculated
+ * based on the Baal Hatanya's netz
+ * amiti and shkiah amiti using a dip of 1.583° below the sea level horizon. This calculation divides
+ * the day based on the opinion of the Baal Hatanya that the day runs from {@link #getSunriseBaalHatanya() netz amiti}
+ * to {@link #getSunsetBaalHatanya() shkiah amiti}. The calculations are based on a day from {@link
+ * #getSunriseBaalHatanya() sea level netz amiti} to {@link #getSunsetBaalHatanya() sea level shkiah amiti}.
+ * The day is split into 12 equal parts with each one being a shaah zmanis. This method is similar to {@link
+ * #getTemporalHour}, but all calculations are based on a sea level sunrise and sunset.
+ * @return the long
millisecond length of a shaah zmanis calculated from
+ * {@link #getSunriseBaalHatanya() netz amiti (sunrise)} to {@link #getSunsetBaalHatanya() shkiah amiti
+ * ("real" sunset)}. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a
+ * year where the sun does not rise, and one where it does not set, {@link Long#MIN_VALUE} will be returned. See
+ * detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getTemporalHour(Date, Date)
+ * @see #getSunriseBaalHatanya()
+ * @see #getSunsetBaalHatanya()
+ * @see #ZENITH_1_POINT_583
+ */
+ public func getShaahZmanisBaalHatanya() -> Int64 {
+ return getTemporalHour(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya());
+ }
+
+ /**
+ * Returns the Baal Hatanya's alos
+ * (dawn) calculated as the time when the sun is 16.9° below the eastern {@link #GEOMETRIC_ZENITH geometric horizon}
+ * before {@link #getSunrise sunrise}. For more information the source of 16.9° see {@link #ZENITH_16_POINT_9}.
+ *
+ * @see #ZENITH_16_POINT_9
+ * @return The Date
of dawn. If the calculation can't be computed such as northern and southern
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
+ * low enough below the horizon for this calculation, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getAlosBaalHatanya() -> Date? {
+ return getSunriseOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_16_POINT_9);
+ }
+
+ /**
+ * This method returns the latest zman krias shema (time to recite Shema in the morning). This time is 3
+ * {@link #getShaahZmanisBaalHatanya() shaos zmaniyos} (solar hours) after {@link #getSunriseBaalHatanya()
+ * netz amiti (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
+ * sunrise to sunset. This returns the time 3 * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya()
+ * netz amiti (sunrise)}.
+ *
+ * @see ZmanimCalendar#getSofZmanShma(Date, Date)
+ * @see #getShaahZmanisBaalHatanya()
+ * @return the Date
of the latest zman shema according to the Baal Hatanya. If the calculation
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
+ * not rise, and one where it does not set, a nil
will be returned. See detailed explanation on
+ * top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSofZmanShmaBaalHatanya() -> Date? {
+ return getSofZmanShma(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest zman tfilah (time to recite the morning prayers). This time is 4
+ * hours into the day based on the opinion of the Baal Hatanya that the day is
+ * calculated from sunrise to sunset. This returns the time 4 * {@link #getShaahZmanisBaalHatanya()} after
+ * {@link #getSunriseBaalHatanya() netz amiti (sunrise)}.
+ *
+ * @see ZmanimCalendar#getSofZmanTfila(Date, Date)
+ * @see #getShaahZmanisBaalHatanya()
+ * @return the Date
of the latest zman tfilah. If the calculation can't be computed such as in
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
+ * not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getSofZmanTfilaBaalHatanya() -> Date? {
+ return getSofZmanTfila(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya(), synchronous: true);
+ }
+
+ /**
+ * This method returns the latest time one is allowed eating chametz on Erev Pesach according to the
+ * opinion of the Baal Hatanya. This time is identical to the {@link #getSofZmanTfilaBaalHatanya() Sof zman
+ * tfilah Baal Hatanya}. This time is 4 hours into the day based on the opinion of the Baal Hatanya that the day
+ * is calculated from sunrise to sunset. This returns the time 4 {@link #getShaahZmanisBaalHatanya()} after
+ * {@link #getSunriseBaalHatanya() netz amiti (sunrise)}. If it is not erev Pesach, a nil will be
+ * returned.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @see #getShaahZmanisBaalHatanya()
+ * @see #getSofZmanTfilaBaalHatanya()
+ * @return the Date
one is allowed eating chametz on Erev Pesach. If it is not erev
+ * Pesach or the calculation can't be computed such as in the Arctic Circle where there is at least one
+ * day a year where the sun does not rise, and one where it does not set, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSofZmanAchilasChametzBaalHatanya() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getSofZmanTfilaBaalHatanya();
+ } else {
+ return nil;
+ }*/
+ return getSofZmanTfilaBaalHatanya();
+ }
+
+ /**
+ * This method returns the latest time for burning chametz on Erev Pesach according to the opinion of
+ * the Baal Hatanya. This time is 5 hours into the day based on the opinion of the Baal Hatanya that the day is calculated
+ * from sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisBaalHatanya()} after
+ * {@link #getSunriseBaalHatanya() netz amiti (sunrise)}. If it is not erev Pesach, a nil will be returned.
+ * @todo in v 3.0.0 enable the calendar check for erev pesach and return nil
in all other cases.
+ * @see #getShaahZmanisBaalHatanya()
+ * @return the Date
of the latest time for burning chametz on Erev Pesach. If it is not
+ * erev Pesach or the calculation can't be computed such as in the Arctic Circle where there is at
+ * least one day a year where the sun does not rise, and one where it does not set, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSofZmanBiurChametzBaalHatanya() -> Date? {
+ /*JewishCalendar jewishCalendar = new JewishCalendar();
+ jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
+ getCalendar().get(Calendar.DAY_OF_MONTH));
+ if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
+ return getTimeOffset(getSunriseBaalHatanya(), getShaahZmanisBaalHatanya() * 5);
+ } else {
+ return nil;
+ }*/
+ return ComplexZmanimCalendar.getTimeOffset(time: getSunriseBaalHatanya(), offset: getShaahZmanisBaalHatanya() * 5);
+ }
+
+ /**
+ * This method returns the time of mincha gedola. Mincha gedola is the earliest time one can pray
+ * mincha. The Rambam is of the opinion that it is
+ * better to delay mincha until {@link #getMinchaKetanaBaalHatanya() mincha ketana} while the
+ * Ra"sh,
+ * Tur, GRA and others are of the opinion that mincha can be prayed
+ * lechatchila starting at mincha gedola. This is calculated as 6.5 {@link #getShaahZmanisBaalHatanya()
+ * sea level solar hours} after {@link #getSunriseBaalHatanya() netz amiti (sunrise)}. This calculation is based
+ * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
+ * * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() netz amiti ("real" sunrise)}.
+ * @todo Consider adjusting this to calculate the time as 30 clock or zmaniyos minutes after either {@link
+ * #getSunTransit() astronomical chatzos} or {@link #getChatzosAsHalfDay() chatzos as half a day}
+ * for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
+ * @see #getMinchaGedola(Date, Date)
+ * @see #getShaahZmanisBaalHatanya()
+ * @see #getMinchaKetanaBaalHatanya()
+ * @return the Date
of the time of mincha gedola according to the Baal Hatanya. If the calculation
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
+ * and one where it does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaGedolaBaalHatanya() -> Date? {
+ return getMinchaGedola(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya(), synchronous: true);
+ }
+
+ /**
+ * FIXME syncronous
+ * This is a convenience method that returns the later of {@link #getMinchaGedolaBaalHatanya()} and
+ * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisBaalHatanya()
+ * shaah zmanis} is less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise
+ * {@link #getMinchaGedolaBaalHatanya()} will be returned.
+ * @todo Consider adjusting this to calculate the time as 30 clock or zmaniyos minutes after either {@link
+ * #getSunTransit() astronomical chatzos} or {@link #getChatzosAsHalfDay() chatzos as half a day}
+ * for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
+ * @return the Date
of the later of {@link #getMinchaGedolaBaalHatanya()} and {@link #getMinchaGedola30Minutes()}.
+ * If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
+ * where the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaGedolaBaalHatanyaGreaterThan30() -> Date? {
+ if (getMinchaGedola30Minutes() == nil || getMinchaGedolaBaalHatanya() == nil) {
+ return nil;
+ } else {
+ if getMinchaGedola30Minutes()!.timeIntervalSince1970 > getMinchaGedolaBaalHatanya()!.timeIntervalSince1970 {
+ return getMinchaGedola30Minutes()
+ } else {
+ return getMinchaGedolaBaalHatanya()
+ }
+ }
+ }
+
+ /**
+ * This method returns the time of mincha ketana. This is the preferred earliest time to pray
+ * mincha in the opinion of the Rambam and others.
+ * For more information on this see the documentation on {@link #getMinchaGedolaBaalHatanya() mincha gedola}.
+ * This is calculated as 9.5 {@link #getShaahZmanisBaalHatanya() sea level solar hours} after {@link #getSunriseBaalHatanya()
+ * netz amiti (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
+ * day is calculated from sunrise to sunset. This returns the time 9.5 * {@link #getShaahZmanisBaalHatanya()} after {@link
+ * #getSunriseBaalHatanya() netz amiti (sunrise)}.
+ *
+ * @see #getMinchaKetana(Date, Date)
+ * @see #getShaahZmanisBaalHatanya()
+ * @see #getMinchaGedolaBaalHatanya()
+ * @return the Date
of the time of mincha ketana. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getMinchaKetanaBaalHatanya() -> Date? {
+ return getMinchaKetana(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya(), synchronous: true);
+ }
+
+ /**
+ * This method returns the time of plag hamincha. This is calculated as 10.75 hours after sunrise. This
+ * calculation is based on the opinion of the Baal Hatanya that the day is calculated
+ * from sunrise to sunset. This returns the time 10.75 * {@link #getShaahZmanisBaalHatanya()} after
+ * {@link #getSunriseBaalHatanya() netz amiti (sunrise)}.
+ *
+ * @see #getPlagHamincha(Date, Date)
+ * @return the Date
of the time of plag hamincha. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ */
+ public func getPlagHaminchaBaalHatanya() -> Date? {
+ return getPlagHamincha(startOfDay: getSunriseBaalHatanya(), endOfDay: getSunsetBaalHatanya(), synchronous: true);
+ }
+
+ /**
+ * A method that returns tzais (nightfall) when the sun is 6° below the western geometric horizon
+ * (90°) after {@link #getSunset sunset}. For information on the source of this calculation see
+ * {@link #ZENITH_6_DEGREES}.
+ *
+ * @return The Date
of nightfall. If the calculation can't be computed such as northern and southern
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
+ * low enough below the horizon for this calculation, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #ZENITH_6_DEGREES
+ */
+ public func getTzaisBaalHatanya() -> Date? {
+ return getSunsetOffsetByDegrees(offsetZenith: ComplexZmanimCalendar.ZENITH_6_DEGREES);
+ }
+
+ /**
+ * A utility method to calculate zmanim based on Rav Moshe
+ * Feinstein as calculated in MTJ, Yeshiva of Staten Island, and Camp Yeshiva
+ * of Staten Island. The day is split in two, from alos / sunrise to fixed local chatzos, and the
+ * second half of the day, from fixed local chatzos to sunset / tzais. Morning based times are calculated
+ * based on the first 6 hours, and afternoon times based on the second half of the day.
+ * //@Deprecated This method will be replaced in v3.0.0 by the more generic {@link
+ * ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)} method.
+ *
+ * @param startOfHalfDay
+ * The start of the half day. This would be alos or sunrise for morning based times and fixed
+ * local chatzos for the second half of the day.
+ * @param endOfHalfDay
+ * The end of the half day. This would be fixed local chatzos for morning based times and sunset
+ * or tzais for afternoon based times.
+ * @param hours
+ * the number of hours to offset the beginning of the first or second half of the day
+ *
+ * @return the Date
of the zman based on calculation of the first or second half of the day. If
+ * the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
+ * the sun does not rise, and one where it does not set, a nil
will be returned. See detailed
+ * explanation on top of the {@link AstronomicalCalendar} documentation.
+ *
+ * @see ComplexZmanimCalendar#getFixedLocalChatzos()
+ * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
+ */
+ ////@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
+ public func getFixedLocalChatzosBasedZmanim(startOfHalfDay:Date?, endOfHalfDay:Date?, hours:Double) -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: startOfHalfDay, endOfHalfDay: endOfHalfDay, hours: hours);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman krias shema (latest time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) that the
+ * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
+ * at alos defined as {@link #getAlos18Degrees() 18°} and ends at {@link #getFixedLocalChatzos() fixed local
+ * chatzos}. Sof Zman Shema is 3 shaos zmaniyos (solar hours) after alos or half of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos18Degrees()
+ * @see #getFixedLocalChatzos()
+ * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanShmaMGA18DegreesToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getAlos18Degrees(), endOfHalfDay: getFixedLocalChatzos(), hours: 3);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman krias shema (latest time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) that the
+ * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
+ * at alos defined as {@link #getAlos16Point1Degrees() 16.1°} and ends at {@link #getFixedLocalChatzos() fixed local
+ * chatzos}. Sof Zman Shema is 3 shaos zmaniyos (solar hours) after this alos or half of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos16Point1Degrees()
+ * @see #getFixedLocalChatzos()
+ * @see #getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getAlos16Point1Degrees(), endOfHalfDay: getFixedLocalChatzos(), hours: 3);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman krias shema (latest time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) that the
+ * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
+ * at alos defined as {@link #getAlos90() 90 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
+ * fixed local chatzos}. Sof Zman Shema is 3 shaos zmaniyos (solar hours) after this alos or
+ * half of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos90()
+ * @see #getFixedLocalChatzos()
+ * @see #getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanShmaMGA90MinutesToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getAlos90(), endOfHalfDay: getFixedLocalChatzos(), hours: 3);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman krias shema (latest time to recite Shema in the morning) according to the
+ * opinion of the Magen Avraham (MGA) that the
+ * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
+ * at alos defined as {@link #getAlos72() 72 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
+ * fixed local chatzos}. Sof Zman Shema is 3 shaos zmaniyos (solar hours) after this alos or
+ * half of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getAlos72()
+ * @see #getFixedLocalChatzos()
+ * @see #getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanShmaMGA72MinutesToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getAlos72(), endOfHalfDay: getFixedLocalChatzos(), hours: 3);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman krias shema (latest time to recite Shema in the morning) according to the
+ * opinion of the GRA that the day is calculated from
+ * sunrise to sunset, but calculated using the first half of the day only. The half a day starts at {@link #getSunrise()
+ * sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. Sof zman Shema is 3 shaos
+ * zmaniyos (solar hours) after sunrise or half of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getSunrise()
+ * @see #getFixedLocalChatzos()
+ * @see #getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanShmaGRASunriseToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getSunrise(), endOfHalfDay: getFixedLocalChatzos(), hours: 3);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of the
+ * calculation of sof zman tfila (zman tfilah (the latest time to recite the morning prayers))
+ * according to the opinion of the GRA that the day is
+ * calculated from sunrise to sunset, but calculated using the first half of the day only. The half a day starts at
+ * {@link #getSunrise() sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. Sof zman tefila
+ * is 4 shaos zmaniyos (solar hours) after sunrise or 2/3 of this half-day.
+ *
+ * @return the Date
of the latest zman krias shema. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ * @see #getSunrise()
+ * @see #getFixedLocalChatzos()
+ * @see #getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getSofZmanTfilaGRASunriseToFixedLocalChatzos() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getSunrise(), endOfHalfDay: getFixedLocalChatzos(), hours: 4);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion of
+ * the calculation of mincha gedola, the earliest time one can pray mincha GRAthat is 30 minutes after {@link #getFixedLocalChatzos() fixed
+ * local chatzos}.
+ *
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getMinchaGedola()
+ * @see #getFixedLocalChatzos()
+ * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
+ */
+ public func getMinchaGedolaGRAFixedLocalChatzos30Minutes() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getFixedLocalChatzos(), offset: ComplexZmanimCalendar.MINUTE_MILLIS * 30);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion
+ * of the calculation of mincha ketana (the preferred time to recite the mincha prayers according to
+ * the opinion of the Rambam and others) calculated according
+ * to the GRA that is 3.5 shaos zmaniyos (solar
+ * hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
+ *
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getMinchaGedola()
+ * @see #getFixedLocalChatzos()
+ * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
+ * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getMinchaKetanaGRAFixedLocalChatzosToSunset() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getFixedLocalChatzos(), endOfHalfDay: getSunset(), hours: 3.5);
+ }
+
+ /**
+ * This method returns Rav Moshe Feinstein's opinion
+ * of the calculation of plag hamincha. This method returns plag hamincha calculated according to the
+ * GRA that the day ends at sunset and is 4.75 shaos
+ * zmaniyos (solar hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
+ *
+ * @return the Date
of the time of mincha gedola. If the calculation can't be computed such as
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
+ * does not set, a nil
will be returned. See detailed explanation on top of the
+ * {@link AstronomicalCalendar} documentation.
+ *
+ * @see #getPlagHamincha()
+ * @see #getFixedLocalChatzos()
+ * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
+ * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
+ * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
+ */
+ public func getPlagHaminchaGRAFixedLocalChatzosToSunset() -> Date? {
+ return getHalfDayBasedZman(startOfHalfDay: getFixedLocalChatzos(), endOfHalfDay: getSunset(), hours: 4.75);
+ }
+
+ /**
+ * Method to return tzais (dusk) calculated as 50 minutes after sea level sunset. This method returns
+ * tzais (nightfall) based on the opinion of Rabbi Moshe Feinstein for the New York area. This time should
+ * not be used for latitudes different than the NY area.
+ *
+ * @return the Date
representing the time. If the calculation can't be computed such as in the Arctic
+ * Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
+ * a nil
will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
+ * documentation.
+ */
+ public func getTzais50() -> Date? {
+ return ComplexZmanimCalendar.getTimeOffset(time: getElevationAdjustedSunset(), offset: 50 * ComplexZmanimCalendar.MINUTE_MILLIS);
+ }
+
+ /**
+ * A method for calculating samuch lemincha ketana, / near mincha ketana time that is half an hour before
+ * {@link #getMinchaKetana()} or is 9 * {@link #getShaahZmanisGra() shaos zmaniyos} (solar hours) after {@link
+ * #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()}
+ * setting), calculated according to the GRA using a day starting at
+ * sunrise and ending at sunset. This is the time that eating or other activity can't begin prior to praying mincha.
+ * The calculation used is 9 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() alos
+ * 16.1°}. See the Mechaber and Mishna Berurah
+ * 232 for details.
+ *
+ * @see #getShaahZmanisGra()
+ * @see #getSamuchLeMinchaKetana16Point1Degrees()
+ * @see #isUseAstronomicalChatzosForOtherZmanim()
+ * @return the Date
of the time of samuch lemincha ketana. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be
+ * returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSamuchLeMinchaKetanaGRA() -> Date? {
+ return getSamuchLeMinchaKetana(startOfDay: getElevationAdjustedSunrise(), endOfDay: getElevationAdjustedSunset(), synchronous: true);
+ }
+
+ /**
+ * A method for calculating samuch lemincha ketana, / near mincha ketana time that is half an hour
+ * before {@link #getMinchaGedola16Point1Degrees()} or 9 * shaos zmaniyos (temporal hours) after the start of
+ * the day, calculated using a day starting and ending 16.1° below the horizon. This is the time that eating or other
+ * activity can't begin prior to praying mincha. The calculation used is 9 * {@link
+ * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() alos 16.1°}. See the Mechaber and Mishna Berurah 232.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @return the Date
of the time of samuch lemincha ketana. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSamuchLeMinchaKetana16Point1Degrees() -> Date? {
+ return getSamuchLeMinchaKetana(startOfDay: getAlos16Point1Degrees(), endOfDay: getTzais16Point1Degrees(), synchronous: true);
+ }
+
+ /**
+ * A method for calculating samuch lemincha ketana, / near mincha ketana time that is half an hour before
+ * {@link #getMinchaKetana72Minutes()} or 9 * shaos zmaniyos (temporal hours) after the start of the day,
+ * calculated using a day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the time that eating
+ * or other activity can't begin prior to praying mincha. The calculation used is 9 * {@link
+ * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() alos 16.1°}. See the Mechaber and Mishna Berurah 232.
+ *
+ * @see #getShaahZmanis16Point1Degrees()
+ * @return the Date
of the time of samuch lemincha ketana. If the calculation can't be computed such
+ * as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
+ * where the sun may not reach low enough below the horizon for this calculation, a nil
will be returned.
+ * See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
+ */
+ public func getSamuchLeMinchaKetana72Minutes() -> Date? {
+ return getSamuchLeMinchaKetana(startOfDay: getAlos72(), endOfDay: getTzais72(), synchronous: true);
+ }
+}
diff --git a/KosherSwiftTests/KosherSwiftTests.swift b/KosherSwiftTests/KosherSwiftTests.swift
index e00a1bd..3afd893 100644
--- a/KosherSwiftTests/KosherSwiftTests.swift
+++ b/KosherSwiftTests/KosherSwiftTests.swift
@@ -394,6 +394,27 @@ class KosherSwiftTests: XCTestCase {
XCTAssertEqual(alot, gregorianCalendar.date(from: decFirst))
}
+
+ func testZmanim() {
+ let geoLocation = GeoLocation(locationName: "CO", latitude: 39.6240, longitude: -104.8709, timeZone: TimeZone.current)
+ let calculator = ComplexZmanimCalendar(location: geoLocation)
+ let format = DateFormatter()
+ format.timeStyle = .full
+ print(format.string(from: calculator.getAlos72Zmanis()!))
+ print(format.string(from: calculator.getAlosHashachar()!))
+ print(format.string(from: calculator.getSunrise()!))
+ print(format.string(from: calculator.getSofZmanShmaMGA()!))
+ print(format.string(from: calculator.getSofZmanShmaGRA()!))
+ print(format.string(from: calculator.getSofZmanTfilaMGA()!))
+ print(format.string(from: calculator.getSofZmanTfilaGRA()!))
+ print(format.string(from: calculator.getChatzos()!))
+ print(format.string(from: calculator.getMinchaGedola()!))
+ print(format.string(from: calculator.getMinchaKetana()!))
+ print(format.string(from: calculator.getPlagHamincha()!))
+ print(format.string(from: calculator.getSeaLevelSunset()!))
+ print(format.string(from: calculator.getTzais72()!))
+ print(format.string(from: calculator.getTzais()!))
+ }
// func testPerformanceExample() throws {
// // This is an example of a performance test case.