Function sun_times::sun_times
[−]
[src]
pub fn sun_times(
date: Date<Utc>,
latitude: f64,
longitude: f64,
elevation: f64
) -> (DateTime<Utc>, DateTime<Utc>)
Calculates the approximate sunset and sunrise times at a given latitude, longitude, and altitude
Arguments
date
- The date on which to calculate the sunset and sunriselatitude
- The latitude at which to calculate the times. Expressed as degreeslongitude
- The longitude at which to calculate the times. Expressed as degreeselevation
- The elevation at which to calculate the times. Expressed as meters above sea level
Return value
Returns a tuple of (sunrise,sunset)
Examples
//Calculate the sunset and sunrise times today at Sheffield university's new computer science building let times = sun_times(Utc::today(),53.38,-1.48,100.0); println!("Sunrise: {}, Sunset: {}",times.0,times.1);