Crates.io | sunrise |
lib.rs | sunrise |
version | 1.0.1 |
source | src |
created_at | 2018-12-15 08:06:37.646089 |
updated_at | 2023-06-21 14:58:54.636468 |
description | Sunrise and sunset calculator |
homepage | |
repository | https://github.com/nathan-osman/rust-sunrise |
max_upload_size | |
id | 101994 |
size | 25,906 |
This crate provides a function for calculating sunrise and sunset times using this method.
In order to perform the calculation, you'll need to provide the following:
Begin by adding this crate to Cargo.toml
:
[dependencies]
sunrise = "1.0.0"
Next, add a declaration for the crate:
extern crate sunrise;
You can use
the sunrise_sunset
function to perform the calculation:
// Calculate times for January 1, 2016 in Toronto
let (sunrise, sunset) = sunrise::sunrise_sunset(
43.6532,
79.3832,
2016,
1,
1,
);