DiffTime

Trait DiffTime 

Source
pub trait DiffTime {
    // Required methods
    fn diff(&self, other: &Dayjs, unit: Unit) -> i64;
    fn diff_milliseconds(&self, other: &Dayjs) -> i64;
    fn diff_seconds(&self, other: &Dayjs) -> i64;
    fn diff_minutes(&self, other: &Dayjs) -> i64;
    fn diff_hours(&self, other: &Dayjs) -> i64;
    fn diff_days(&self, other: &Dayjs) -> i64;
    fn diff_weeks(&self, other: &Dayjs) -> i64;
    fn diff_months(&self, other: &Dayjs) -> i64;
    fn diff_years(&self, other: &Dayjs) -> i64;
}
Expand description

Trait for calculating differences between times

Required Methods§

Source

fn diff(&self, other: &Dayjs, unit: Unit) -> i64

Get the difference between two times in the specified unit

Source

fn diff_milliseconds(&self, other: &Dayjs) -> i64

Get the difference in milliseconds

Source

fn diff_seconds(&self, other: &Dayjs) -> i64

Get the difference in seconds

Source

fn diff_minutes(&self, other: &Dayjs) -> i64

Get the difference in minutes

Source

fn diff_hours(&self, other: &Dayjs) -> i64

Get the difference in hours

Source

fn diff_days(&self, other: &Dayjs) -> i64

Get the difference in days

Source

fn diff_weeks(&self, other: &Dayjs) -> i64

Get the difference in weeks

Source

fn diff_months(&self, other: &Dayjs) -> i64

Get the difference in months

Source

fn diff_years(&self, other: &Dayjs) -> i64

Get the difference in years

Implementors§