use jiff::{civil, tz::TimeZone};
use rust_zmanim::prelude::*;
fn main() {
let date = civil::date(2025, 7, 29);
let beit_meir = GeoLocation::new(
31.7975,
35.0345,
526.0,
TimeZone::get("Asia/Jerusalem").unwrap(),
)
.unwrap();
if let Some(sunrise) = zmanim_calculator::hanetz(date, &beit_meir, false) {
println!("Sunrise: {}", sunrise.strftime("%Y-%m-%d %H:%M:%S %Z"));
}
if let Some(tzeis_degrees) =
zmanim_calculator::tzeis(date, &beit_meir, false, &ZmanOffset::Degrees(6.13))
{
println!(
"Tzeis (6.13 deg): {}",
tzeis_degrees.strftime("%Y-%m-%d %H:%M:%S %Z")
);
}
let czc = ComplexZmanimCalendar::new(beit_meir, date, UseElevation::No);
if let Some(alos120) = czc.alos_120_minutes() {
println!(
"Alos (120 min): {}",
alos120.strftime("%Y-%m-%d %H:%M:%S %Z")
);
}
if let Some(sz18) = czc.shaah_zmanis_mga_18_degrees() {
println!("Shaah zmanis (MGA 18 deg): {sz18:#}");
}
let north_pole = GeoLocation::new(90.0, 0.0, 0.0, TimeZone::UTC).unwrap();
let polar_sunset = zmanim_calculator::shkia(date, &north_pole, false);
println!("Sunset at the North Pole in July: {polar_sunset:?}");
}