| Crates.io | sunrise-lite |
| lib.rs | sunrise-lite |
| version | 1.0.0 |
| created_at | 2022-07-19 22:33:18.250879+00 |
| updated_at | 2022-07-19 22:33:18.250879+00 |
| description | Sunrise and sunset calculator for no_std systems |
| homepage | |
| repository | https://gitlab.com/mtczekajlo/rust-sunrise-lite |
| max_upload_size | |
| id | 628566 |
| size | 10,782 |
This crate provides a function for calculating sunrise and sunset times using this method.
Forked from https://github.com/nathan-osman/rust-sunrise.
In order to perform the calculation, you'll need to provide the following:
Begin by adding this crate to Cargo.toml:
[dependencies]
sunrise-lite = "1.0.0"
Next, add a declaration for the crate:
use sunrise_lite;
You can use the sunrise_sunset function to perform the calculation:
// Calculate times for January 1, 2016 in Toronto
let (sunrise, sunset) = sunrise_lite::sunrise_sunset(
43.6532,
-79.3832,
2016,
1,
1,
);