Skip to main content

baal_hatanya/
baal_hatanya.rs

1//! Example of using [`ComplexZmanimCalendar`] to calculate *zmanim*. Calculates
2//! *zmanim* at the *kosel* according to the *shita* of the *Baal HaTanya*
3
4use jiff::{Zoned, tz::TimeZone};
5use rust_zmanim::prelude::*;
6
7fn main() {
8    let jerusalem = TimeZone::get("Asia/Jerusalem").unwrap();
9    let today = Zoned::now().date();
10
11    // your location here
12    let kosel = GeoLocation::new(31.777, 35.234, 700.0, jerusalem).unwrap();
13
14    let czc = ComplexZmanimCalendar::new(kosel, today, UseElevation::No);
15
16    let alos = czc.alos_baal_hatanya().unwrap();
17    let hanetz = czc.hanetz().unwrap();
18    let szks = czc.sof_zman_shema_baal_hatanya().unwrap();
19    let szt = czc.sof_zman_tefila_baal_hatanya().unwrap();
20    let chatzos = czc.chatzos_hayom().unwrap();
21    let mg = czc.mincha_gedola_baal_hatanya().unwrap();
22    let mk = czc.mincha_ketana_baal_hatanya().unwrap();
23    let plag = czc.plag_baal_hatanya().unwrap();
24    let shkia = czc.shkia().unwrap();
25    let tzeis = czc.tzeis_baal_hatanya().unwrap();
26    let shaah = czc.shaah_zmanis_baal_hatanya().unwrap();
27
28    println!(
29        "alos:         {alos}
30hanetz:       {hanetz}
31SZKS:         {szks}
32SZT:          {szt}
33chatzos:      {chatzos}
34MG:           {mg}
35MK:           {mk}
36shkia:        {shkia}
37plag:         {plag}
38tzeis:        {tzeis}
39shaah zmanis: {shaah}"
40    )
41}