Expand description
Halachic time calculations (zmanim) for a geographic location and civil date.
This module computes Jewish prayer and ritual times — sunrise, sunset, alos,
tzeis, chatzos, candle lighting, and dozens of other presets aligned with
KosherJava method names. Results are
jiff::Timestamp values in UTC; convert to local time with the location’s
timezone when presenting them to users.
§How it fits together
- Build a
Location(latitude, longitude, elevation, optional timezone). - Create a
ZmanimCalculatorfor that location, ajiff::civil::Date, and aCalculatorConfigthat selects elevation and chatzos behavior. - Pass any
ZmanLikevalue toZmanimCalculator::calculate.
Most callers use the ready-made constants in presets (for example
presets::ELEVATION_ADJUSTED_SUNRISE). Each preset is a ZmanPreset backed
by a low-level ZmanPrimitive expression.
Failures return ZmanimError — unlike calendar or limud lookups, which use
Option when a value simply does not apply on a given date. Some zmanim cannot
be calculated at extreme latitudes or on polar days; others require a timezone
on the location (for example Kiddush Levana via molad::MoladCalendar).
§Submodules
presets— named zman constants (ELEVATION_ADJUSTED_SUNRISE,CANDLE_LIGHTING, …)types::config—CalculatorConfigoptions (elevation, chatzos, offsets)types::location—Locationvalidation and timezone requirementstypes::error—ZmanimErrorreturned by invalid input or impossible calculationsprimitives—ZmanPrimitivebuilding blocks for custom zman definitionsmolad— molad and Kiddush Levana times viamolad::MoladCalendar
§Quick start
use jiff::{civil::Date, tz::TimeZone};
use kosher_rust::zmanim::prelude::*;
let location = Location::new(
40.09,
-74.22,
0.0,
Some(TimeZone::get("America/New_York").unwrap()),
)
.unwrap();
let calc = ZmanimCalculator::new(
location,
Date::new(2017, 10, 17).unwrap(),
CalculatorConfig::default(),
);
calc.calculate(&presets::ELEVATION_ADJUSTED_SUNRISE).unwrap();Import prelude (or crate::prelude) for calculator types, the presets
module, and ZmanPrimitive building blocks.
Modules§
- molad
- Molad and Kiddush Levana time calculations.
- prelude
- Common zmanim imports.
- presets
- Generated by tools/generate-rust.py. Do not edit by hand.
- primitives
- Low-level zman formulas used to build higher-level presets.
- types
- Core zmanim types: configuration, errors, and location.
Structs§
- Zman
Preset - A named zman preset backed by a low-level
ZmanPrimitive. - Zmanim
Calculator - Calculates zmanim for a
Locationon a specificDate.
Traits§
- Zman
Like - A zman definition that can be calculated by a
ZmanimCalculator.