pub struct TimeTool;Implementations§
Source§impl TimeTool
impl TimeTool
pub fn new() -> Self
pub fn now(&self) -> DateTime<Utc>
pub fn today(&self) -> NaiveDate
pub fn parse_date(&self, s: &str) -> Result<NaiveDate>
pub fn parse_datetime(&self, s: &str) -> Result<DateTime<Utc>>
pub fn add_days(&self, dt: DateTime<Utc>, days: i64) -> DateTime<Utc>
pub fn add_months(&self, dt: DateTime<Utc>, months: u32) -> DateTime<Utc>
pub fn start_of_day(&self, dt: DateTime<Utc>) -> DateTime<Utc>
pub fn end_of_day(&self, dt: DateTime<Utc>) -> DateTime<Utc>
pub fn days_between(&self, dt1: DateTime<Utc>, dt2: DateTime<Utc>) -> i64
pub fn to_timezone( &self, dt: DateTime<Utc>, tz_str: &str, ) -> Result<DateTime<Tz>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeTool
impl RefUnwindSafe for TimeTool
impl Send for TimeTool
impl Sync for TimeTool
impl Unpin for TimeTool
impl UnsafeUnpin for TimeTool
impl UnwindSafe for TimeTool
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