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§
Sourcefn diff(&self, other: &Dayjs, unit: Unit) -> i64
fn diff(&self, other: &Dayjs, unit: Unit) -> i64
Get the difference between two times in the specified unit
Sourcefn diff_milliseconds(&self, other: &Dayjs) -> i64
fn diff_milliseconds(&self, other: &Dayjs) -> i64
Get the difference in milliseconds
Sourcefn diff_seconds(&self, other: &Dayjs) -> i64
fn diff_seconds(&self, other: &Dayjs) -> i64
Get the difference in seconds
Sourcefn diff_minutes(&self, other: &Dayjs) -> i64
fn diff_minutes(&self, other: &Dayjs) -> i64
Get the difference in minutes
Sourcefn diff_hours(&self, other: &Dayjs) -> i64
fn diff_hours(&self, other: &Dayjs) -> i64
Get the difference in hours
Sourcefn diff_weeks(&self, other: &Dayjs) -> i64
fn diff_weeks(&self, other: &Dayjs) -> i64
Get the difference in weeks
Sourcefn diff_months(&self, other: &Dayjs) -> i64
fn diff_months(&self, other: &Dayjs) -> i64
Get the difference in months
Sourcefn diff_years(&self, other: &Dayjs) -> i64
fn diff_years(&self, other: &Dayjs) -> i64
Get the difference in years