pub struct EasyTime<F: TimeZone> {
pub value: i64,
pub time_now: DateTime<F>,
}
Fields§
§value: i64
§time_now: DateTime<F>
Implementations§
Source§impl EasyTime<Local>
impl EasyTime<Local>
pub fn new(value: i64) -> Self
pub fn new_with_local(time: DateTime<Local>, value: i64) -> Self
pub fn in_future( value: i64, time_unit: TimeUnits, time: Option<DateTime<Local>>, ) -> DateTime<Local>
pub fn in_past( value: i64, time_unit: TimeUnits, time: Option<DateTime<Local>>, ) -> DateTime<Local>
Source§impl EasyTime<Utc>
impl EasyTime<Utc>
pub fn new_with_utc(value: i64) -> Self
pub fn new_with_utc_time(time: DateTime<Utc>, value: i64) -> Self
pub fn in_future( value: i64, time_unit: TimeUnits, time: Option<DateTime<Utc>>, ) -> DateTime<Utc>
pub fn in_past( value: i64, time_unit: TimeUnits, time: Option<DateTime<Utc>>, ) -> DateTime<Utc>
Source§impl<F: TimeZone> EasyTime<F>
impl<F: TimeZone> EasyTime<F>
pub fn from_time(time: DateTime<F>) -> Self
Sourcepub fn new_with_time(value: i64, time: DateTime<F>) -> Self
pub fn new_with_time(value: i64, time: DateTime<F>) -> Self
Creates an EasyTime
with a specific time_now
in any timezone F
.
pub fn set_value(&mut self, value: i64)
pub fn set_time(&mut self, time: DateTime<F>)
pub fn get_value(&self) -> i64
pub fn get_time(&self) -> DateTime<F>
pub fn offset(time: DateTime<F>, duration: Duration) -> DateTime<F>
pub fn offset_neg(time: DateTime<F>, duration: Duration) -> DateTime<F>
pub fn seconds_from_now(&self) -> DateTime<F>
pub fn seconds_ago(&self) -> DateTime<F>
pub fn minutes_from_now(&self) -> DateTime<F>
pub fn minutes_ago(&self) -> DateTime<F>
pub fn hours_from_now(&self) -> DateTime<F>
pub fn hours_ago(&self) -> DateTime<F>
pub fn days_from_now(&self) -> DateTime<F>
pub fn days_ago(&self) -> DateTime<F>
pub fn months_from_now(&self) -> DateTime<F>
pub fn months_ago(&self) -> DateTime<F>
pub fn years_from_now(&self) -> DateTime<F>
pub fn years_ago(&self) -> DateTime<F>
pub fn decades_from_now(&self) -> DateTime<F>
pub fn decades_ago(&self) -> DateTime<F>
pub fn centuries_from_now(&self) -> DateTime<F>
pub fn centuries_ago(&self) -> DateTime<F>
pub fn millenniums_from_now(&self) -> DateTime<F>
pub fn millenniums_ago(&self) -> DateTime<F>
pub fn to_string(&self) -> String
pub fn to_string_with_format(&self, format_str: &str) -> String
pub fn to_string_with_timezone(&self) -> String
pub fn to_string_with_timezone_format(&self, format_str: &str) -> String
pub fn to_string_with_timezone_format_with_timezone( &self, format_str: &str, ) -> String
pub fn to_timestamp(&self) -> i64
pub fn to_date(&self) -> String
pub fn to_time(&self) -> String
pub fn to_date_time(&self) -> String
pub fn to_date_time_with_timezone_format(&self, format_str: &str) -> String
Trait Implementations§
impl<F: Eq + TimeZone> Eq for EasyTime<F>
impl<F: TimeZone> StructuralPartialEq for EasyTime<F>
Auto Trait Implementations§
impl<F> Freeze for EasyTime<F>
impl<F> RefUnwindSafe for EasyTime<F>
impl<F> Send for EasyTime<F>
impl<F> Sync for EasyTime<F>
impl<F> Unpin for EasyTime<F>
impl<F> UnwindSafe for EasyTime<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more