circadia 0.1.0

Compute sunrise/sunset times
Documentation
  • Coverage
  • 47.37%
    9 out of 19 items documented0 out of 0 items with examples
  • Size
  • Source code size: 26.45 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 24s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • irrio/circadia
    3 3 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hoggetaylor

Circadia

This crate provides a simple interface to compute information about the sunrise and sunset times on arbitrary dates at any position on the globe.

Installation

$ cargo add circadia --version 0.0.1

Usage

use circadia::{ GlobalPosition, SunEvent, time_of_event };
use chrono::Utc;

fn main() {
    // Nauticalia Greenwhich
    let pos = GlobalPosition::at(51.4810066, 0.0081805);
    let today = Utc::now().date();
    let sunrise_time = time_of_event(today, &pos, SunEvent::SUNRISE).unwrap();
    println!("Time of sunrise today: {}", sunrise_time.format("%r"));
}