TimeZone

Trait TimeZone 

Source
pub trait TimeZone {
    // Required methods
    fn millis(&self) -> f64;
    fn offset(&self) -> f64;
    fn julian_offset(&self) -> f64;
    fn julian_date_universal_time(&self) -> f64;
    fn body_host_ratio(&self) -> f64;
    fn julian_date_terrestial_time(&self) -> f64;
    fn julian_date_2000_time(&self) -> f64;
    fn day_date(&self) -> f64;
    fn fractional_hour(&self) -> f64;
    fn fractional_minute(&self) -> f64;
    fn coordinated_time(&self) -> f64;
    fn now(&self) -> Time;
}
Expand description

This trait acts as a common field for all all planets, asteroids, moons, exo-planets, and comets.

The timezone is implemented for specific timezones because each timezone has specific calculations to generate a time from UTC.

Required Methods§

Source

fn millis(&self) -> f64

This method gets the millisencds since j2000 epoch

Source

fn offset(&self) -> f64

This method calibrates the body specific timezones

Source

fn julian_offset(&self) -> f64

This method calculates the julian day offset from the coordinated time offset

Source

fn julian_date_universal_time(&self) -> f64

This method gets the jd_ut of the timezone

Source

fn body_host_ratio(&self) -> f64

This method calculates (body / host) rotational periods

Body Earth Ratio

  • body_rotational_period / earth_rotational_period

Body Moon Ratio

  • moon_rotational_period / body_rotational_period (host planet of the exact moon)
Source

fn julian_date_terrestial_time(&self) -> f64

This method gets the jd_tt of the timezone

Source

fn julian_date_2000_time(&self) -> f64

This method gets the jd2000 time

Source

fn day_date(&self) -> f64

This method gets the day date for a timezone (msd, vsd, …)

Source

fn fractional_hour(&self) -> f64

This method is the fractional hour that splits the day_date to hours

Source

fn fractional_minute(&self) -> f64

This method is the fractional hour that splits the day_date to minutes

Source

fn coordinated_time(&self) -> f64

This method gets the coordinated time

Source

fn now(&self) -> Time

This method generates a new timezone and returns the time for it

Implementors§