|
use chrono::prelude::Local;
|
|
|
|
pub fn get_moon_phase() -> f32 {
|
|
let local_timestamp = Local::now();
|
|
let unixtime = suncalc::Timestamp(local_timestamp.timestamp_millis());
|
|
let moon_illumination = suncalc::moon_illumination(unixtime);
|
|
|
|
moon_illumination.phase as f32 * 28.0
|
|
}
|