Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

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;fnmain(){// Nauticalia Greenwhichlet 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"));}

About

Compute sunrise/sunset times.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages