| Crates.io | zmanim-core |
| lib.rs | zmanim-core |
| version | 0.2.7 |
| created_at | 2025-08-26 03:21:48.299465+00 |
| updated_at | 2025-10-13 06:42:43.768955+00 |
| description | A high-performance, `no_std` Rust library for calculating Jewish religious times (zmanim) and astronomical events. |
| homepage | |
| repository | https://github.com/dickermoshe/zmanim-core |
| max_upload_size | |
| id | 1810459 |
| size | 5,930,238 |
[!NOTE] If you are looking for the Python Readme, please see zmanim-core-bindings.
If you are looking for the Javascript Readme, please see zmanim-core-bindings.
A high-performance, no_std Rust library for calculating Jewish religious times (zmanim) and astronomical events. This library provides accurate calculations for sunrise, sunset, prayer times, and Jewish calendar dates based on astronomical algorithms.
no_std compatible for embedded and WASM use casesThis fork closely follows the original KosherJava api where possible. See the JavaDoc for documentation: https://kosherjava.com/zmanim/docs/api/index.html?overview-summary.html
Run the following
cargo add zmanim-core
use zmanim_core::prelude::*;
use chrono::{DateTime, Utc};
// Create a location (Jerusalem coordinates)
let location = GeoLocation::new(
31.78, // latitude
35.22, // longitude
754.0, // elevation in meters
);
// Create a calendar for a specific date
let timestamp = chrono::Utc::now().timestamp_millis();
let calendar = ZmanimCalendar::new(
timestamp,
location,
false, // Use astronomical chatzos for zmanim
false, // Use astronomical chatzos for other zmanim
18 * 60 * 1000, // Candle lighting offset in milliseconds
);
// Get sunrise and sunset times
if let Some(alos72) = calendar.get_alos72() {
println!("Alos72: {}", DateTime::from_timestamp_millis(alos72).unwrap());
}
if let Some(sunset) = calendar.get_astronomical_calendar().get_sunset() {
println!("Sunset: {}", DateTime::from_timestamp_millis(sunset).unwrap());
}
// Get Jewish date information
let jewish_date = JewishDate::from_gregorian(
timestamp,
4 * 60 * 60 * 1000, // Timezone offset in milliseconds (4 Hours)
);
println!("Jewish Date: {} {}, {}",
jewish_date.get_day_of_month(),
jewish_date.get_jewish_month_name(),
jewish_date.get_jewish_year()
);
This library includes comprehensive testing against the original KosherJava implementation to ensure accuracy and correctness.
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test module
cargo test zmanim_calendar_tests
The test suite includes:
Unit tests for all modules
Integration tests against Java reference implementation
Astronomical calculation accuracy tests
Jewish calendar correctness tests
Cross-platform compatibility tests
The library supports multiple build targets:
tests/We welcome contributions! Please see our contributing guidelines:
# Clone the repository
git clone https://github.com/dickermoshe/zmanim-core.git
cd zmanim-core
# Install dependencies
cargo build
# Run tests
cargo test
# Check formatting
cargo fmt --check
# Run clippy
cargo clippy
This project is licensed under the MIT License - see the LICENSE file for details.
This library is a Rust port of the KosherJava library, which provides the reference implementation and testing framework. Special thanks to the KosherJava contributors for their excellent work.
Made with โค๏ธ for the Jewish community and Rust enthusiasts