zmanim-calculator 0.5.2

A comprehensive Rust library for calculating Zmanim with no_std support
Documentation

This crate is part of the Rust Zmanim Project.

Zmanim Calculator

A Rust library for calculating halachic zmanim (times), following KosherJava naming and behavior. Supports no_std environments.

Crates.io Documentation codecov

Installation

cargo add zmanim-calculator chrono

Or manually add to your Cargo.toml:

[dependencies]
zmanim-calculator = "0.1"

Usage

use chrono::{NaiveDate, Utc};
use zmanim_calculator::{
    prelude::{CalculatorConfig, Location, ZmanimCalculator},
    presets::{SUNRISE, TZAIS_MINUTES_72},
};

fn main() {
    let location = Location::new(40.7128, -74.0060, 10.0, Some(Utc)).expect("valid location");
    let date = NaiveDate::from_ymd_opt(2026, 3, 1).expect("valid date");
    let mut calc =
        ZmanimCalculator::new(location, date, CalculatorConfig::default()).expect("calculator");

    let sunrise = calc.calculate(SUNRISE).expect("sunrise");
    let tzais = calc.calculate(TZAIS_MINUTES_72).expect("tzais");

    println!("Sunrise (UTC): {sunrise}");
    println!("Tzais 72 (UTC): {tzais}");
}

If you omit a timezone, calculations near the anti-meridian (|longitude| > 150) will fail. Kiddush Levana and Molad calculations require a timezone as well.

Feature Flags

  • std — Enables standard library support
  • defmt — Enables defmt formatting/logging for embedded targets

Compatibility

The API aims to follow KosherJava naming and behavior where possible. For background and broader algorithm documentation, see the KosherJava documentation.

License

Licensed under LGPL-2.1. See LICENSE for details.