Skip to main content

Module zmanim

Module zmanim 

Source
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

  1. Build a Location (latitude, longitude, elevation, optional timezone).
  2. Create a ZmanimCalculator for that location, a jiff::civil::Date, and a CalculatorConfig that selects elevation and chatzos behavior.
  3. Pass any ZmanLike value to ZmanimCalculator::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

§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§

ZmanPreset
A named zman preset backed by a low-level ZmanPrimitive.
ZmanimCalculator
Calculates zmanim for a Location on a specific Date.

Traits§

ZmanLike
A zman definition that can be calculated by a ZmanimCalculator.