Class ZmanimCalendar
java.lang.Object
com.kosherjava.zmanim.AstronomicalCalendar
com.kosherjava.zmanim.ZmanimCalendar
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ComprehensiveZmanimCalendar
The ZmanimCalendar is a specialized calendar that can calculate sunrise, sunset and Jewish zmanim (religious times)
for prayers and other Jewish religious duties. This class contains the main functionality of the Zmanim library. For
a much more extensive list of zmanim, use the
ComprehensiveZmanimCalendar that extends this class. See
documentation for the ComprehensiveZmanimCalendar and AstronomicalCalendar for simple examples on using the API.
Elevation based zmanim (even sunrise and sunset) should not be used lekula without the guidance
of a posek. According to Rabbi Dovid Yehudah Bursztyn in his Zmanim Kehilchasam, 7th edition chapter 2, section 7 (pages 181-182) and section 9 (pages 186-187), no zmanim
besides sunrise and sunset should use elevation. However, Rabbi Yechiel Avrahom Zilber in the Birur Halacha Vol. 6 Ch. 58 Pages 34 and 42 is of the opinion that elevation should be accounted for
in zmanim calculations. Related to this, Rabbi Yaakov Karp in Shimush Zekeinim, Ch. 1, page 17 states that obstructing horizons should be factored into zmanim calculations. The
setting defaults to false (elevation will not be used for zmanim calculations besides sunrise and sunset), unless the
setting is changed to true in setUseElevation(boolean). This will impact sunrise and sunset-based zmanim such as
AstronomicalCalendar.getSunrise(), AstronomicalCalendar.getSunset(), getSofZmanShmaGRA(), alos-based
zmanim such as getSofZmanShmaMGA72Minutes() that are based on a fixed offset of sunrise or sunset and
zmanim based on a percentage of the day such as ComprehensiveZmanimCalendar.getSofZmanShmaMGA90MinutesZmanis()
that are based on sunrise and sunset. Even when set to true it will not impact zmanim that are a degree-based offset of
sunrise and sunset, such as ComprehensiveZmanimCalendar.getSofZmanShmaMGA16Point1Degrees() or ComprehensiveZmanimCalendar.getSofZmanShmaBaalHatanya() since these zmanim are not linked to sunrise or sunset times
(the calculations are based on the astronomical definition of sunrise and sunset calculated in a vacuum with the solar radius
above the horizon), and are therefore not impacted by the use of elevation. For additional information on the halachic
impact of elevation on zmanim see:
- Zmanei Halacha Lema'aseh 4th edition by Rabbi Yedidya Manat. See section 1, pages 11-12 for a very concise write-up, with details in section 2, pages 37 - 63 and 133 - 151.
- Zmanim Kehilchasam 7th edition, by Rabbi Dovid Yehuda Burstein, vol 1, chapter 2, pages 95 - 188.
- Hazmanim Bahalacha by Rabbi Chaim Banish , perek 7, pages 53 - 63.
Note: It is important to read the technical notes on top of the AstronomicalCalculator documentation
before using this code.
I would like to thank Rabbi Yaakov Shakow, the author of Luach Ikvei Hayom who spent a considerable amount of time reviewing, correcting and making suggestions on the documentation in this library.
Disclaimer:
I did my best to get accurate results, but please double-check before relying on these zmanim for halacha lema'aseh.- Author:
- © Eliyahu Hershfeld 2004 - 2026
-
Nested Class Summary
Nested classes/interfaces inherited from class AstronomicalCalendar
AstronomicalCalendar.SolarEventModifier and TypeClassDescriptionprotected static enumAn enum to indicate what type of solar event is being calculated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleThe default Shabbos candle lighting offset is 18 minutes.private booleanIs astronomical chatzos used for zmanim calculations.private booleanIs astronomical chatzos used for zmanim calculations besides chatzos itself for enhanced accuracy.private booleanIs elevation factored in for some zmanim (seeisUseElevation()for additional information).protected static final doubleThe zenith of 1.583° belowgeometric zenith(90°).protected static final doubleThe zenith of 16.1° below geometric zenith (90°).protected static final doubleThe zenith of 8.5° below geometric zenith (90°).Fields inherited from class AstronomicalCalendar
ASTRONOMICAL_ZENITH, CIVIL_ZENITH, GEOMETRIC_ZENITH, HOUR_MILLIS, MINUTE_MILLIS, NAUTICAL_ZENITHModifier and TypeFieldDescriptionstatic final doubleSun's zenith at astronomical twilight (108°).static final doubleSun's zenith at civil twilight (96°).static final double90° below the vertical.static final longconstant for milliseconds in an hour (3,600,000)static final longconstant for milliseconds in a minute (60,000)static final doubleSun's zenith at nautical twilight (102°). -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor will set a defaultGeoLocation(), a defaultAstronomicalCalculatorand default the calendar to the current date.ZmanimCalendar(GeoLocation location) A constructor that takes aGeoLocationas a parameter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns alos (dawn) based on the time when the sun is16.1°below the easterngeometric horizonbeforesunrise.Method to return alos (dawn) calculated as 72 minutes beforesunriseorsea level sunrise(depending on theisUseElevation()setting).A method to return candle lighting time, calculated asgetCandleLightingOffset()minutes beforesea level sunset.doubleA method to get the offset in minutes beforesea level sunsetwhich is used in calculating candle lighting time.getChatzos(Instant begin, Instant end) A method that returns chatzos (hayom or layla) calculated as halfway between the begin and end times passed in.A method that returns chatzos halayla at the end of the day (the last zman of the day returned by the calendar, that may actually be after midnight of the day it is being calculated for).This method returnsAstronomical chatzos hayomif thecalculatorclass used supports it andisUseAstronomicalChatzos()is set to true or thehalfway point between sunrise and sunsetif it does not support it, or it is not configured to use it.Returns chatzos calculated as halfway between sunrise and sunset.longgetHalfDayBasedShaahZmanis(Instant startOfHalfDay, Instant endOfHalfDay) A utility method to calculate the length of a sha'ah zmanis based on 1/6 of a 6-hour day.getHalfDayBasedZman(Instant startOfHalfDay, Instant endOfHalfDay, double hours) A utility method to calculate zmanim based on Rav Moshe Feinstein and others as calculated in MTJ, Yeshiva of Staten Island, and Camp Yeshiva of Staten Island and other calendars.getMinchaGedola(Instant startOfDay, Instant endOfDay) A generic method for calculating mincha gedola that callsgetMinchaGedola(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getMinchaGedola(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating mincha gedola (the earliest time to recite the mincha prayers) that is 6.5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.This method returns the latest mincha gedola,the earliest time one can pray mincha that is 6.5 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA.getMinchaKetana(Instant startOfDay, Instant endOfDay) A generic method for calculating mincha ketana that callsgetMinchaKetana(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getMinchaKetana(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating mincha ketana, (the preferred time to recite the mincha prayers in the opinion of the Rambam and others) that is 9.5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.This method returns mincha ketana,the preferred earliest time to pray mincha in the opinion of the Rambam and others, that is 9.5 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA.doublegetPercentOfShaahZmanisFromDegrees(double degrees, boolean sunset) A utility method that returns the percentage of a shaah zmanis after sunset (or before sunrise) for a given degree offset.getPlagHamincha(Instant startOfDay, Instant endOfDay) A generic method for calculating plag hamincha that callsgetPlagHamincha(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getPlagHamincha(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating plag hamincha (the earliest time that Shabbos can be started) that is 10.75 hours after the start of the day, (or 1.25 hours before the end of the day) based on the start and end of the day passed to the method.This method returns plag hamincha, that is 10.75 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA.getSamuchLeMinchaKetana(Instant startOfDay, Instant endOfDay) A generic method for calculating samuch lemincha ketana that callsgetSamuchLeMinchaKetana(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getSamuchLeMinchaKetana(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating samuch lemincha ketana, / near mincha ketana time that is half an hour beforegetMinchaKetana(java.time.Instant,java.time.Instant)or 9 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.longA method that returns a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on a 72-minute alos and tzais.getShaahZmanisBasedZman(Instant startOfDay, Instant endOfDay, double hours) A generic utility method for calculating any shaah zmanis (temporal hour) based zman with the day defined as the start and end of day (or night) and the number of shaos zmaniyos passed to the method.longA method that returns a shaah zmanis (temporal hour) according to the opinion of the GRA.getSofZmanAchilasChametz(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating sof zman achilas chametz or the latest time one is allowed eating chametz on Erev Pesach that is 4 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.getSofZmanBiurChametz(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating sof zman biur chametz or the latest time one is allowed burning chametz on Erev Pesach that is 5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.getSofZmanShma(Instant startOfDay, Instant endOfDay) A generic method for calculating the latest zman krias shema that callsgetSofZmanShma(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getSofZmanShma(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating the latest zman krias shema (time to recite shema in the morning) that is 3 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.This method returns the latest zman krias shema (time to recite shema in the morning) that is 3 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA.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 being72minutes beforesunrise.getSofZmanTfila(Instant startOfDay, Instant endOfDay) A generic method for calculating the latest zman tfila that callsgetSofZmanTfila(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous.getSofZmanTfila(Instant startOfDay, Instant endOfDay, boolean synchronous) A generic method for calculating the latest zman tfilah (time to recite the morning prayers) that is 4 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method.This method returns the latest zman tfila (time to recite shema in the morning) that is 4 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA.This method returns the latest zman tfila (time to recite shema in the morning) that is 4 *shaos zmaniyos(solar hours) aftergetAlos72Minutes(), according to the Magen Avraham (MGA).protected InstantA method that returns the Baal Hatanya's netz amiti (sunrise) withoutAstronomicalCalculator.getElevationAdjustment(double).protected InstantThis method will returnsea level sunriseifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunrise()if it is true.protected InstantA method that returns the Baal Hatanya's shkiah amiti (sunset) withoutelevation adjustment.protected InstantThis method will returnsea level sunriseifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunrise()if it is true.This method returns the tzais (nightfall) based on the opinion of Rabbeinu Tam that tzais hakochavim is calculated as 72 minutes after sunset, the time it takes to walk 4 mil at 18 minutes a mil.A method that returns tzais (nightfall) when the sun is8.5°below thegeometric horizon(90°) aftersunset, a time that Rabbi Meir Posen in his the Ohr Meir calculated that 3 small stars are visible, which is later than the required 3 medium stars.getZmanisBasedOffset(double hours) A utility method to return alos (dawn) or tzais (dusk) based on a fractional day offset.inthashCode()booleanisAssurBemelacha(Instant currentTime, Instant tzais, boolean inIsrael) This is a utility method to determine if the current Instant passed in has a melacha (work) prohibition.booleanbooleanIs astronomical chatzos used for zmanim calculations besides chatzos itself for enhanced accuracy.booleanIs elevation above sea level calculated for times besides sunrise and sunset.voidsetCandleLightingOffset(double candleLightingOffset) A method to set the offset in minutes beforesea level sunsetthat is used in calculating candle lighting time.voidsetUseAstronomicalChatzos(boolean useAstronomicalChatzos) Sets if astronomical chatzos should be used in calculations of other zmanim for enhanced accuracy.voidsetUseAstronomicalChatzosForOtherZmanim(boolean useAstronomicalChatzosForOtherZmanim) Sets if astronomical chatzos should be used in calculations of other zmanim for enhanced accuracy.voidsetUseElevation(boolean useElevation) Sets whether elevation above sea level is factored into zmanim calculations for times besides sunrise and sunset.Methods inherited from class AstronomicalCalendar
clone, getAdjustedLocalDate, getAstronomicalCalculator, getBeginAstronomicalTwilight, getBeginCivilTwilight, getBeginNauticalTwilight, getEndAstronomicalTwilight, getEndCivilTwilight, getEndNauticalTwilight, getGeoLocation, getInstantFromTime, getLocalDate, getLocalMeanTime, getMidnightLastNight, getMidnightTonight, getSeaLevelSunrise, getSeaLevelSunset, getSolarMidnight, getSunrise, getSunriseOffsetByDegrees, getSunriseSolarDipFromOffset, getSunset, getSunsetOffsetByDegrees, getSunsetSolarDipFromOffset, getSunTransit, getSunTransit, getTemporalHour, getTemporalHour, getTimeAtAzimuth, getTimeOffset, getTimeOffset, getUTCSeaLevelSunrise, getUTCSeaLevelSunset, getUTCSunrise, getUTCSunset, setAstronomicalCalculator, setGeoLocation, setLocalDate, toJSON, toStringModifier and TypeMethodDescriptionclone()A method that creates a deep copy of the object.protected LocalDateAdjusts theLocalDateto deal with edge cases where the location crosses the antimeridian.A method that returns the currently set AstronomicalCalculator.A method that returns the beginning of astronomical twilight using a zenith of108°.A method that returns the beginning of civil twilight (dawn) using a zenith of96°.A method that returns the beginning of nautical twilight using a zenith of102°.A method that returns the end of astronomical twilight using a zenith of108°.A method that returns the end of civil twilight using a zenith of96°.A method that returns the end of nautical twilight using a zenith of102°.A method that returns the currently setGeoLocationwhich contains location information used for the astronomical calculations.protected InstantgetInstantFromTime(double time, AstronomicalCalendar.SolarEvent solarEvent) A method that returns anInstantfrom the time passed in as a parameter.returns theLocalDateobject encapsulated in this class.getLocalMeanTime(LocalTime localTime) A method that returns local mean time (LMT) time converted to regular clock time for the local wall-clock time passed to this method.protected ZonedDateTimeUsed by Molad based zmanim to determine if zmanim occur during the current day.protected ZonedDateTimeUsed by Molad based zmanim to determine if zmanim occur during the current day.A method that returns the sunrise withoutelevation adjustment.A method that returns the sunset withoutelevation adjustment.A method that returns solar midnight as the end of the day (that may actually be after midnight of the day it is being calculated for).The getSunrise method returns aInstantrepresenting the#getElevationAdjustment(double) elevation adjustedsunrise time.getSunriseOffsetByDegrees(double offsetZenith) A utility method that returns the time of an offset by degrees below or above the horizon ofsunrise.doublegetSunriseSolarDipFromOffset(double minutes) Deprecated.This method is slow and inefficient and should NEVER be used in a loop.The getSunset method returns anInstantrepresenting theelevation adjustedsunset time.getSunsetOffsetByDegrees(double offsetZenith) A utility method that returns the time of an offset by degrees below or above the horizon ofsunset.doublegetSunsetSolarDipFromOffset(double minutes) Deprecated.This method is slow and inefficient and should NEVER be used in a loop.A method that returns sundial or solar noon.getSunTransit(Instant startOfDay, Instant endOfDay) A method that returns sundial or solar noon (or midnight) calculated as halfway between the times passed in.longA method that returns a sea-level based temporal (solar) hour.longgetTemporalHour(Instant startOfDay, Instant endOfDay) A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset passed as parameters to this method.getTimeAtAzimuth(double azimuth) Return the time at a given azimuth.static InstantgetTimeOffset(Instant time, double offset) A utility method that returns a date offset by the offset time passed in as a parameter.static InstantgetTimeOffset(Instant time, long offsetMillis) A utility method that returns anInstantoffset by the offset time passed in.doublegetUTCSeaLevelSunrise(double zenith) A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using daylight savings time.doublegetUTCSeaLevelSunset(double zenith) A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and without using daylight savings time.doublegetUTCSunrise(double zenith) A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using daylight savings time.doublegetUTCSunset(double zenith) A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using daylight savings time.voidsetAstronomicalCalculator(AstronomicalCalculator astronomicalCalculator) A method to set theAstronomicalCalculatorused for astronomical calculations.voidsetGeoLocation(GeoLocation geoLocation) Sets theGeoLocationObjectto be used for astronomical calculations.voidsetLocalDate(LocalDate localDate) Sets theLocalDateobject for us in this class.toJSON()Returns a JSON formatted representation of the class using the default output of thetoJSONmethod.toString()Returns an XML formatted representation of the class using the default output of thetoXMLmethod.
-
Field Details
-
useElevation
Is elevation factored in for some zmanim (seeisUseElevation()for additional information).- See Also:
-
useAstronomicalChatzos
Is astronomical chatzos used for zmanim calculations. The default value oftruewill keep the standard astronomical chatzos calculation, while setting it tofalsewill use half of a solar day / night calculation for chatzos.- See Also:
-
useAstronomicalChatzosForOtherZmanim
Is astronomical chatzos used for zmanim calculations besides chatzos itself for enhanced accuracy. The default value offalsewill keep the standard start to end of day calculations, while setting it totruewill use half of a solar day calculation for zmanim.- See Also:
-
ZENITH_16_POINT_1
The zenith of 16.1° below geometric zenith (90°).- See Also:
-
ZENITH_8_POINT_5
The zenith of 8.5° below geometric zenith (90°).- See Also:
-
ZENITH_1_POINT_583
The zenith of 1.583° belowgeometric zenith(90°).- See Also:
-
candleLightingOffset
The default Shabbos candle lighting offset is 18 minutes. This can be changed via thesetCandleLightingOffset(double)and retrieved by thegetCandleLightingOffset().
-
-
Constructor Details
-
ZmanimCalendar
public ZmanimCalendar()Default constructor will set a defaultGeoLocation(), a defaultAstronomicalCalculatorand default the calendar to the current date.- See Also:
-
ZmanimCalendar
A constructor that takes aGeoLocationas a parameter.- Parameters:
location- the location
-
-
Method Details
-
isUseElevation
Is elevation above sea level calculated for times besides sunrise and sunset. According to Rabbi Dovid Yehuda Bursztyn in his Zmanim Kehilchasam (second edition published in 2007) chapter 2 (pages 186-187) no zmanim besides sunrise and sunset should use elevation. However, Rabbi Yechiel Avrahom Zilber in the Birur Halacha Vol. 6 Ch. 58 Pages 34 and 42 is of the opinion that elevation should be accounted for in zmanim calculations. Related to this, Rabbi Yaakov Karp in Shimush Zekeinim, Ch. 1, page 17 states that obstructing horizons should be factored into zmanim calculations.The setting defaults to false (elevation will not be used for zmanim calculations), unless the setting is changed to true insetUseElevation(boolean). This will impact sunrise and sunset based zmanim such asgetSofZmanShmaGRA(), alos based zmanim such asgetSofZmanShmaMGA72Minutes()that are based on a fixed offset of sunrise or sunset and zmanim based on a percentage of the day such asComprehensiveZmanimCalendar.getSofZmanShmaMGA90MinutesZmanis()that are based on sunrise and sunset. It will not impact zmanim that are a degree based offset of sunrise and sunset, such asComprehensiveZmanimCalendar.getSofZmanShmaMGA16Point1Degrees()orComprehensiveZmanimCalendar.getSofZmanShmaBaalHatanya().- Returns:
- if the use of elevation is active
- See Also:
-
setUseElevation
Sets whether elevation above sea level is factored into zmanim calculations for times besides sunrise and sunset. SeeisUseElevation()for more details.- Parameters:
useElevation- set to true to use elevation in zmanim calculations- See Also:
-
isUseAstronomicalChatzos
Isastronomical chatzosused forgetChatzosHayom()andgetChatzosHalayla()for enhanced accuracy. For example as the day lengthens, the second half of the day is longer than the first and astronomical chatzos would be a drop earlier than half of the time between sunrise and sunset.- Returns:
- if the use of astronomical chatzos is active.
- See Also:
- TODO:
- In the future, if this is set to true, the following may change to enhance accuracy.
Sof zman Shma GRAwould be calculated as 3 shaos zmaniyos after sunrise, but the shaos zmaniyos would be calculated a a 6th of the time between sunrise and chatzos, as opposed to a 12th of the time between sunrise and sunset.mincha gedolawill be calculated as half a shaah zmanis of afternoon hours (a 6th of the time between chatzos and sunset after astronomical chatzos as opposed to 6.5 shaos zmaniyos after sunrise.Plag haminchawould be calculated as 4.75 shaos zmaniyos after astronomical chatzos as opposed to 10.75 shaos zmaniyos after sunrise. Etc.
-
setUseAstronomicalChatzos
Sets if astronomical chatzos should be used in calculations of other zmanim for enhanced accuracy.- Parameters:
useAstronomicalChatzos- set to true to use astronomical in chatzos in zmanim calculations.- See Also:
-
isUseAstronomicalChatzosForOtherZmanim
Is astronomical chatzos used for zmanim calculations besides chatzos itself for enhanced accuracy. For example as the day is lengthening (as we approach spring season), the second half of the day is longer than the first and astronomical chatzos would be a drop earlier than half of the time between sunrise and sunset. Conversely, the second half of the day would be shorter in the autumn as the days start getting shorter.- Returns:
- if the use of astronomical chatzos is active.
- See Also:
- TODO:
- In the future, if this is set to true, the following may change to enhance accuracy.
Sof zman Shma GRAwould be calculated as 3 shaos zmaniyos after sunrise, but the shaos zmaniyos would be calculated a a 6th of the time between sunrise and chatzos, as opposed to a 12th of the time between sunrise and sunset.mincha gedola GRAwill be calculated as half a shaah zmanis of afternoon hours (a 6th of the time between chatzos and sunset after astronomical chatzos as opposed to 6.5 shaos zmaniyos after sunrise.Plag haminchawould be calculated as 4.75 shaos zmaniyos after astronomical chatzos as opposed to 10.75 shaos zmaniyos after sunrise. Etc.
-
setUseAstronomicalChatzosForOtherZmanim
Sets if astronomical chatzos should be used in calculations of other zmanim for enhanced accuracy.- Parameters:
useAstronomicalChatzosForOtherZmanim- set to true to use astronomical in chatzos in zmanim calculations.- See Also:
-
getSunriseBasedOnElevationSetting
This method will returnsea level sunriseifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunrise()if it is true. This allows relevant zmanim in this and extending classes (such as theComprehensiveZmanimCalendar) to automatically adjust to the elevation setting.- Returns:
AstronomicalCalendar.getSeaLevelSunrise()ifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunrise()if it is true.- See Also:
-
getSunsetBasedOnElevationSetting
This method will returnsea level sunriseifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunrise()if it is true. This allows relevant zmanim in this and extending classes (such as theComprehensiveZmanimCalendar) to automatically adjust to the elevation setting.- Returns:
AstronomicalCalendar.getSeaLevelSunset()ifisUseElevation()is false (the default), or elevation adjustedAstronomicalCalendar.getSunset()if it is true.- See Also:
-
getTzaisGeonim8Point5Degrees
A method that returns tzais (nightfall) when the sun is8.5°below thegeometric horizon(90°) aftersunset, a time that Rabbi Meir Posen in his the Ohr Meir calculated that 3 small stars are visible, which is later than the required 3 medium stars. This calculation is based on the sun's position below the horizon 36 minutes aftersunsetin Jerusalem around the equinox / equilux, which is 8.5° belowgeometric zenith.- Returns:
- The
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. ComprehensiveZmanimCalendar#getTzaisGeonim8Point5Degrees() that returns an identical time to this generic tzais
-
getAlos16Point1Degrees
Returns alos (dawn) based on the time when the sun is16.1°below the easterngeometric horizonbeforesunrise. This is based on the calculation that the time between dawn and sunrise (and sunset to nightfall) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes a mil (Rambam and others). The sun's position below the horizon 72 minutes beforesunrisein Jerusalem on the around the equinox / equilux is 16.1° belowAstronomicalCalendar.GEOMETRIC_ZENITH.- Returns:
- The
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getAlos72Minutes
Method to return alos (dawn) calculated as 72 minutes beforesunriseorsea level sunrise(depending on theisUseElevation()setting). This time is based on the time to walk the distance of 4 mil at 18 minutes a mil. The 72-minute time (but not the concept of fixed minutes) is based on the opinion that the time of the Neshef (twilight between dawn and sunrise) does not vary by the time of year or location but depends on the time it takes to walk the distance of 4 mil.- Returns:
- the
Instantrepresenting 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getChatzosHayom
This method returnsAstronomical chatzos hayomif thecalculatorclass used supports it andisUseAstronomicalChatzos()is set to true or thehalfway point between sunrise and sunsetif it does not support it, or it is not configured to use it. There are currently twocalculatorsavailable in the API, the defaultNOAA calculatorand theUSNO calculator. The USNO calculator calculates chatzos as halfway between sunrise and sunset (identical to six shaos zmaniyos after sunrise), while the NOAACalculator calculates it more accurately asastronomical chatzos. See The Definition of Chatzos for a detailed explanation of the ways to calculate Chatzos. Since half-day chatzos can benullin the Arctic on a day when either sunrise or sunset did not happen and astronomical chatzos can be calculated even in the Arctic, if half-day chatzos calculates asnulland astronomical chatzos is supported by the calculator, astronomical chatzos will be returned to avoid returning anull.- Returns:
- the
Instantof chatzos. If the calculation can't be computed such as in the Arctic Circle where there is at least one day where the sun does not rise, and one where it does not set, and the calculator does not support astronomical calculations (that will never report anull) anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getChatzosHalayla
A method that returns chatzos halayla at the end of the day (the last zman of the day returned by the calendar, that may actually be after midnight of the day it is being calculated for). For example, if calculating it for the date of Erev Pesach, the calculation will be for Lail Pesach to allow you to use the zman as sof zman achilas chametz.Astronomical chatzos halaylawill be returned if thecalculatorclass used supports it andisUseAstronomicalChatzos()is set to true. Otherwise thehalfway pointbetween sunset and the following day's sunrise, if it does not support it, or it is not configured to use it. There are currently twocalculatorsavailable in the API, the defaultNOAA calculatorand theUSNO calculator. The USNO calculator calculates chatzos halayla as halfway between sunset and the following day's sunrise (identical to six shaos zmaniyos after sunset), while the NOAACalculator calculates it more accurately asastronomical chatzos halayla. See The Definition of Chatzos for a detailed explanation of the ways to calculate Chatzos. Since half-night chatzos can benullin the Arctic on a day when either sunset or the following day's sunrise did not happen and astronomical chatzos halayla can be calculated even in the Arctic, if half-day chatzos calculates asnulland astronomical chatzos is supported by the calculator, astronomical chatzos will be returned to avoid returning anull.- Returns:
- the
Instantof chatzos halayla at the end of the current day. If the calculation can't be computed such as in the Arctic Circle where there is at least one day where the sun does not rise, and one where it does not set, and the calculator does not support astronomical calculations (that will never report anull) anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getChatzos
A method that returns chatzos (hayom or layla) calculated as halfway between the begin and end times passed in. If sunrise and sunset (or sunset and the following sunrise for chatzos halayla) are passed in, the zman returned will be close to, but not exactly, when the Sun is transiting the celestial meridian due to changes in declination (the lengthening or shortening day). See The Definition of Chatzos for a detailed explanation of the ways to calculate Chatzos. This method is a convenience method that calls the parent class'sAstronomicalCalendar.getSunTransit(java.time.Instant,java.time.Instant). A practical example of using this would be calculating chatzos halayla for the for the end of zman achilas afikoman on Pesach night, where Rav Shlomo Zalman Auerbach in the Halichos Shlomo, Moadim Nisan - Av, ch. 9, no. 44, pages 289-292, questioned the common practice of considering chatzos halayla as astronomical chatzos halayla, and felt that for this it should be at chatzi halayla, halfway between sunset and alos or bedieved from an early tzais that is lower (degree-wise) than alos the next morning, thus making this zman significantly earlier. Rav Moshe Sternbuch in Teshuvos Vehanhagos v. VII, ch 1, p. 3, agreed to this calculation for chatzos halayla on Pesach night.- Parameters:
begin- the beginning of day or night for calculating chatzos. For chatzos hayom, this can be sea level sunrise, or any arbitrary sunrise or alos used as the beginning of the day, and for chatzos halayla this can be sea level sunset, or any arbitrary sunset or tzais used as the beginning of the night.end- the end of day or night for calculating chatzos. For chatzos hayom, this can be sea level sunset, or any arbitrary sunset or tzais used as the end of day, and for chatzos halayla this can be sea level sunrise, or any arbitrary sunrise or alos used as the end of the night.- Returns:
- the
Instantrepresenting 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,nullwill be returned. See detailed explanation on top of the page. - See Also:
-
getChatzosHayomAsHalfDay
Returns chatzos calculated as halfway between sunrise and sunset. Many are of the opinion that chatzos is calculated as the midpoint betweensea level sunriseandsea level sunset, despite it not being the most accurate way to calculate it. A day starting at alos and ending at tzais using the same time or degree offset will also return the same time. In reality due to lengthening or shortening of day, this is not necessarily the exact midpoint of the day, but it is very close. This method allows you to use the NOAACalculator and still calculate chatzos as six shaos zmaniyos after sunrise. There are currently twocalculatorsavailable in the API, theNOAACalculatorand theSunTimesCalculator. The SunTimesCalculator calculates chatzos as halfway between sunrise and sunset (and of six shaos zmaniyos), while the NOAACalculator calculates it as astronomical chatzos that is slightly more accurate. This method allows you to use the NOAACalculator and still calculate chatzos as six shaos zmaniyos after sunrise. See The Definition of Chatzos for a detailed explanation of the ways to calculate Chatzos.- Returns:
- the
Instantof the latest 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanShma
A generic method for calculating the latest zman krias shema (time to recite shema in the morning) that is 3 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and the latest zman krias shema is calculated as 3 of those shaos zmaniyos after the beginning of the day. IfisUseAstronomicalChatzosForOtherZmanim()istrue, the 3 shaos zmaniyos will be based on 1/6 of the time between sunrise andastronomical chatzos. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunsetto this method (orgetSunriseBasedOnElevationSetting()andgetSunsetBasedOnElevationSetting()that is driven off theisUseElevation()setting) will return sof zman krias shema according to the opinion of the GRA. In cases where the start and end dates are not synchronous such as in#getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees()falseshould be passed to the synchronous parameter to ensure thatisUseAstronomicalChatzosForOtherZmanim()will not be used.- Parameters:
startOfDay- the start of day for calculating zman krias shema. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating zman krias shema. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the latest zman shema based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanShma
A generic method for calculating the latest zman krias shema that callsgetSofZmanShma(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating zman krias shema. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating zman krias shema. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the latest zman shema based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanShmaGRA
This method returns the latest zman krias shema (time to recite shema in the morning) that is 3 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA. The day is calculated fromsea level sunrisetosea level sunsetor fromsunrisetosunset(depending on theisUseElevation()setting).- Returns:
- the
Instantof the latest zman shema according to the GRA. 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, anullwill be returned. See the detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanShmaMGA72Minutes
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 being72minutes beforesunrise. This time is 3shaos zmaniyos(solar hours) afterdawnbased on the opinion of the MGA that the day is calculated from adawnof 72 minutes before sunrise tonightfallof 72 minutes after sunset. This returns the time of 3 *getShaahZmanis72Minutes()afterdawn.- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getTzais72Minutes
This method returns the tzais (nightfall) based on the opinion of Rabbeinu Tam that tzais hakochavim is calculated as 72 minutes after sunset, the time it takes to walk 4 mil at 18 minutes a mil. According to the Machtzis Hashekel in Orach Chaim 235:3, the Pri Megadim in Orach Chaim 261:2 (see the Biur Halacha) and others (see Hazmanim Bahalacha 17:3 and 17:5) the 72 minutes are standard clock minutes any time of the year in any location. Depending on theisUseElevation()setting, a 72-minute offset from eithersunsetorsea level sunsetis used.- Returns:
- the
Instantrepresenting 72 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, anullwill be returned See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getCandleLighting
A method to return candle lighting time, calculated asgetCandleLightingOffset()minutes beforesea level sunset. This will return the time for any day of the week, since it can be used to calculate candle lighting time for Yom Tov (mid-week holidays) as well. Elevation adjustments are intentionally not performed by this method, but you can calculate it by passing the elevation adjusted sunset toAstronomicalCalendar.getTimeOffset(java.time.Instant,long).- Returns:
- candle lighting 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
nullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanTfila
A generic method for calculating the latest zman tfilah (time to recite the morning prayers) that is 4 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and sof zman tfila is calculated as 4 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) to this method will return zman tfilah according to the opinion of the GRA. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating zman tfilah. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating zman tfilah. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the latest zman tfilah based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getSofZmanBiurChametz
A generic method for calculating sof zman biur chametz or the latest time one is allowed burning chametz on Erev Pesach that is 5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. If the date is not erev Pesach, a null will be returned. The time from the start of day to the end of day is divided into 12 shaos zmaniyos (temporal hours), and sof zman biur chametz is calculated as 5 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetto this method will return sof zman biur chametz according to the opinion of the GRA. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating sof zman biur chametz. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating sof zman biur chametz. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the sof zman biur chametz based on the start and end of day times passed to this method. If the date is not Erev Pesach or 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getSofZmanAchilasChametz
A generic method for calculating sof zman achilas chametz or the latest time one is allowed eating chametz on Erev Pesach that is 4 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. If the date is not erev Pesach, a null will be returned. The time from the start of day to the end of day is divided into 12 shaos zmaniyos (temporal hours), and sof zman achilas chametz is calculated as 4 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetto this method will return sof zman achilas chametz according to the opinion of the GRA. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating sof zman achilas chametz. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating sof zman achilas chametz. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the sof zman achilas chametz based on the start and end of day times passed to this method. If the date is not Erev Pesach or 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getSofZmanTfila
A generic method for calculating the latest zman tfila that callsgetSofZmanTfila(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating zman tfilah. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating zman tfilah. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the latest zman tfilah based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanTfilaGRA
This method returns the latest zman tfila (time to recite shema in the morning) that is 4 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA. The day is calculated fromsea level sunrisetosea level sunsetor fromsunrisetosunset(depending on theisUseElevation()setting).- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSofZmanTfilaMGA72Minutes
This method returns the latest zman tfila (time to recite shema in the morning) that is 4 *shaos zmaniyos(solar hours) aftergetAlos72Minutes(), according to the Magen Avraham (MGA). The day is calculated from 72 minutes beforegetSunriseBasedOnElevationSetting()to 72 minutes aftergetSunsetBasedOnElevationSetting(). The use of elevation depends on theisUseElevation()setting).- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getMinchaGedola
A generic method for calculating mincha gedola (the earliest time to recite the mincha prayers) that is 6.5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and mincha gedola is calculated as 6.5 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) to this method will return mincha gedola according to the opinion of the GRA. Alternatively, this method usesisUseAstronomicalChatzosForOtherZmanim()to control if the time is based on 6.5 shaos zmaniyos into the day mentioned above, or as half an hour zmaniyos based on the second half of the day after chatzos (astronomical chatzosif supported by thecalculatorandconfiguredorchatzos as half a dayif not. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating Mincha gedola. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating Mincha gedola. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the time of Mincha gedola based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getMinchaGedola
A generic method for calculating mincha gedola that callsgetMinchaGedola(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating Mincha gedola. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating Mincha gedola. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the latest Mincha gedola based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getMinchaGedolaGRA
This method returns the latest mincha gedola,the earliest time one can pray mincha that is 6.5 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA. Mincha gedola is the earliest time one can pray mincha. The Ramba"m is of the opinion that it is better to delay mincha untilmincha ketana GRAwhile the Ra"sh, Tur, GRA and others are of the opinion that mincha can be prayed lechatchila starting at mincha gedola. The day is calculated fromsea level sunrisetosea level sunsetorsunrisetosunset(depending on theisUseElevation()setting).- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
- TODO:
- Consider adjusting this to calculate the time as half an hour zmaniyos after
getChatzosHayom()that usesisUseAstronomicalChatzos()to determine the type of chatzos to utilize (if thecalculatorsupport astronomical chatzos), based on theisUseAstronomicalChatzos()setting.
-
getSamuchLeMinchaKetana
A generic method for calculating samuch lemincha ketana, / near mincha ketana time that is half an hour beforegetMinchaKetana(java.time.Instant,java.time.Instant)or 9 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and samuch lemincha ketana is calculated as 9 of those shaos zmaniyos after the beginning of the day. For example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) to this method will return samuch lemincha ketana according to the opinion of the GRA. See the Mechaber and Mishna Berurah 232 and 249:2.- Parameters:
startOfDay- the start of day for calculating samuch lemincha ketana. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating samuch lemincha ketana. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the time of Mincha ketana based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getSamuchLeMinchaKetana
A generic method for calculating samuch lemincha ketana that callsgetSamuchLeMinchaKetana(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating samuch lemincha ketana. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating samuch lemincha ketana. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the time of samuch lemincha ketana based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getMinchaKetana
A generic method for calculating mincha ketana, (the preferred time to recite the mincha prayers in the opinion of the Rambam and others) that is 9.5 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and end of the day passed to this method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and mincha ketana is calculated as 9.5 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) to this method will return mincha ketana according to the opinion of the GRA. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating Mincha ketana. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating Mincha ketana. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the time of Mincha ketana based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getMinchaKetana
A generic method for calculating mincha ketana that callsgetMinchaKetana(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating Mincha ketana. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating Mincha ketana. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the time of Mincha ketana based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getMinchaKetanaGRA
This method returns mincha ketana,the preferred earliest time to pray mincha in the opinion of the Rambam and others, that is 9.5 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA. For more information on this see the documentation onmincha gedola. The day is calculated fromsea level sunrisetosea level sunsetor fromsunrisetosunset(depending on theisUseElevation()setting.- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getPlagHamincha
A generic method for calculating plag hamincha (the earliest time that Shabbos can be started) that is 10.75 hours after the start of the day, (or 1.25 hours before the end of the day) based on the start and end of the day passed to the method. The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours), and plag hamincha is calculated as 10.75 of those shaos zmaniyos after the beginning of the day. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) to this method will return plag mincha according to the opinion of the GRA. This method's synchronous parameter indicates if the start and end of day for the calculation are synchronous, having the same offset. This is typically the case, but some zmanim calculations are based on a start and end at different offsets from the real start and end of the day, such as starting the day at alos and an ending it at tzais Geonim or some other variant. If the day is not synchronous ahalf-day based calculationswill be bypassed. It would be illogical to use a half-day based calculation that start/end at chatzos when the two "halves" of the day are not equal, and the halfway point between them is not at chatzos.- Parameters:
startOfDay- the start of day for calculating plag hamincha. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating plag hamincha. This can be sunset or any tzais passed to this method.synchronous- If the zman has a synchronous start and end of the day. If this isfalse, using aisUseAstronomicalChatzosForOtherZmanim()makes no sense and will be ignored even if set to true, since by definition chatzos will not be the middle of the day for the zman.- Returns:
- the
Instantof the time of plag hamincha based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getPlagHamincha
A generic method for calculating plag hamincha that callsgetPlagHamincha(java.time.Instant,java.time.Instant,boolean)passingfalseto the synchronous parameter since there is no way to know if the start and end of the day are synchronous. Passing true when they are not synchronous is too much of a risk. See information on that method for more details.- Parameters:
startOfDay- the start of day for calculating plag hamincha. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating plag hamincha. This can be sunset or any tzais passed to this method.- Returns:
- the
Instantof the time of plag hamincha based on the start and end of day times passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getPlagHaminchaGRA
This method returns plag hamincha, that is 10.75 *shaos zmaniyos(solar hours) aftersunriseorsea level sunrise(depending on theisUseElevation()setting), according to the GRA. Plag hamincha is the earliest time that Shabbos can be started. The day is calculated fromsea level sunrisetosea level sunsetorsunrisetosunset(depending on theisUseElevation()- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getShaahZmanisGRA
A method that returns a shaah zmanis (temporal hour) according to the opinion of the GRA. This calculation divides the day based on the opinion of the GRA that the day runs from fromsea level sunrisetosea level sunsetorsunrisetosunset(depending on theisUseElevation()setting). The day is split into 12 equal parts with each one being a shaah zmanis. This method is similar toAstronomicalCalendar.getTemporalHour(), but can account for elevation.- Returns:
- the
longmillisecond length of a shaah zmanis calculated from sunrise to 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,Long.MIN_VALUEwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getZmanisBasedOffset
A utility method to return alos (dawn) or tzais (dusk) based on a fractional day offset. As an example passing 1.5 to this method as done in theComprehensiveZmanimCalendar.getTzais90Zmanis()will return the time 90 minutes zmaniyos aftergetSunsetBasedOnElevationSetting(), a zman known as the achtel zman or 1/8th of the length of the day (12 * 60 = 720-minute day / 8 = 90 or 1.5 hours zmaniyos) after sunset.- Parameters:
hours- the number of shaos 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, anullwill be returned (since we can't tell if it is sunrise or sunset based).- Returns:
- the
Instantrepresenting 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. Anullwill also be returned if 0 is passed in, since we can't tell if it is a sunrise or sunset based zman. - See Also:
-
getShaahZmanis72Minutes
A method that returns a shaah zmanis (temporal hour) according to the opinion of the Magen Avraham (MGA) based on a 72-minute alos and tzais. This calculation divides the day that runs from dawn to dusk (for sof zman krias shema and tfila). Dawn for this calculation is 72 minutes beforesunriseorsea level sunrise(depending on theisUseElevation()elevation setting) and dusk is 72 minutes aftersunsetorsea level sunset(depending on theisUseElevation()elevation setting). This day is split into 12 equal parts with each part being a shaah zmanis. Alternate methods of calculating a shaah zmanis according to the Magen Avraham (MGA) are available in the subclassComprehensiveZmanimCalendar.- Returns:
- the
longmillisecond 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,Long.MIN_VALUEwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getCandleLightingOffset
A method to get the offset in minutes beforesea level sunsetwhich is used in calculating candle lighting time. The default time used is 18 minutes before sea level sunset. Some calendars use 15 minutes, while the custom in Jerusalem is to use a 40-minute offset. Please check the local custom for candle lighting time.- Returns:
- Returns the currently set candle lighting offset in minutes.
- See Also:
-
setCandleLightingOffset
A method to set the offset in minutes beforesea level sunsetthat is used in calculating candle lighting time. The default time used is 18 minutes before sunset. Some calendars use 15 minutes, while the custom in Jerusalem is to use a 40-minute offset.- Parameters:
candleLightingOffset- The candle lighting offset to set in minutes.- See Also:
-
isAssurBemelacha
This is a utility method to determine if the current Instant passed in has a melacha (work) prohibition. Since there are many opinions on the time of tzais, the tzais for the current day has to be passed to this class. Sunset is the classes current day'selevation adjusted sunsetthat observes theisUseElevation()settings. TheJewishCalendar.getInIsrael()will be set by the inIsrael parameter.- Parameters:
currentTime- the current timetzais- the time of tzaisinIsrael- whether to use Israel holiday scheme or not- Returns:
- true if melacha is prohibited or false if it is not.
- See Also:
-
getSunriseBaalHatanya
A method that returns the Baal Hatanya's netz amiti (sunrise) withoutAstronomicalCalculator.getElevationAdjustment(double). 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.- Returns:
- the
Instantrepresenting 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, anullwill be returned. See detailed explanation on top of the page. - See Also:
-
getSunsetBaalHatanya
A method that returns the Baal Hatanya's shkiah amiti (sunset) withoutelevation 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° 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.- Returns:
- the
Instantrepresenting 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getShaahZmanisBasedZman
A generic utility method for calculating any shaah zmanis (temporal hour) based zman with the day defined as the start and end of day (or night) and the number of shaos zmaniyos passed to the method. This simplifies the code in other methods such asgetPlagHamincha(java.time.Instant,java.time.Instant)and cuts down on code replication. As an example, passingsunriseandsunsetorsea level sunriseandsea level sunset(depending on theisUseElevation()elevation setting) and 10.75 hours to this method will return plag mincha according to the opinion of the GRA.- Parameters:
startOfDay- the start of day for calculating the zman. This can be sunrise or any alos passed to this method.endOfDay- the end of day for calculating the zman. This can be sunset or any tzais passed to this method.hours- the number of shaos zmaniyos (temporal hours) to offset from the start of day- Returns:
- the
Instantof the time of zman with the shaos zmaniyos (temporal hours) in the day offset from the start of day passed to this method. 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation.
-
getPercentOfShaahZmanisFromDegrees
A utility method that returns the percentage of a shaah zmanis after sunset (or before sunrise) for a given degree offset. For the equilux where there is a 720-minute day, passing 16.1° for the location of Jerusalem will return about 1.2. This will work for any location or date, but will typically only be of interest at the equinox/equilux to calculate the percentage of a shaah zmanis for those who want to use the Minchas Cohen in Ma'amar 2:4 and the Pri Chadash who calculate tzais as a percentage of the day after sunset. While the Minchas Cohen only applies this to 72 minutes or a 1/10 of the day around the world (based on the equinox / equilux in Israel), this method allows calculations for any degree level for any location.- Parameters:
degrees- the number of degrees below the horizon after sunset.sunset- iftruethe calculation should be degrees after sunset, or iffalse, degrees before sunrise.- Returns:
- the
doublepercentage of a sha'ah zmanis for a given set of degrees below the astronomical horizon for the current calendar. If the calculation can't be computed aDouble.MIN_VALUEwill be returned. See detailed explanation on top of the page.
-
getHalfDayBasedZman
A utility method to calculate zmanim based on Rav Moshe Feinstein and others as calculated in MTJ, Yeshiva of Staten Island, and Camp Yeshiva of Staten Island and other calendars. The day is split in two, from alos / sunrise to chatzos, and the second half of the day, from chatzos to sunset / tzais. Morning based times are calculated. based on the first 6 hours of the day, and afternoon times based on the second half of the day. As an example, passing 0.5, a start of chatzos and an end of day as sunset will return the time of mincha gedola GRA as half an hour zmanis based on the second half of the day. Some zmanim calculations can be based on subtracting shaos zmaniyos from the end of the day, and that is supported by passing a negative hour to this method.- Parameters:
startOfHalfDay- The start of the half day. This would be alos or sunrise for morning based times such as sof zman krias shema and chatzos for afternoon based times such as mincha gedola.endOfHalfDay- The end of the half day. This would be chatzos for morning based times such as sof zman krias shema and sunset or tzais for afternoon based times such as mincha gedola.hours- The number of shaos zmaniyos (hours) to offset the beginning of the first or second half of the day. For example, 3 for sof zman Shma, 0.5 for mincha gedola (half an hour after chatzos) and 4.75 for plag hamincha. If the number of hours is negative, it will subtract the number of shaos zmaniyos from the end of the day.- Returns:
- the
Instantof 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, anullwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
-
getHalfDayBasedShaahZmanis
A utility method to calculate the length of a sha'ah zmanis based on 1/6 of a 6-hour day.- Parameters:
startOfHalfDay- The start of the half-day. This would be alos or sunrise for the first half of the day, or chatzos for the second half of the day.endOfHalfDay- The end of the half-day. This would be chatzos for the first half of the day, or sunset or tzais for the second half of the day.- Returns:
- The
longmillisecond length of a shaah zmanis based on 1/6 of a half-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,Long.MIN_VALUEwill be returned. See detailed explanation on top of theAstronomicalCalendardocumentation. - See Also:
- TODO:
- Consider adjusting various shaah zmanis times to use this.
-
equals
- Overrides:
equalsin classAstronomicalCalendar- See Also:
-
hashCode
- Overrides:
hashCodein classAstronomicalCalendar- See Also:
-