pub struct DateTime { /* private fields */ }Implementations§
Source§impl DateTime
impl DateTime
pub const DATE_SHORT: &'static str = locale::DATE_SHORT
pub const DATE_MED: &'static str = locale::DATE_MED
pub const DATE_FULL: &'static str = locale::DATE_FULL
pub const TIME_SIMPLE: &'static str = locale::TIME_SIMPLE
pub const TIME_WITH_SECONDS: &'static str = locale::TIME_WITH_SECONDS
pub const DATETIME_SHORT: &'static str = locale::DATETIME_SHORT
pub const DATETIME_MED: &'static str = locale::DATETIME_MED
pub const DATETIME_FULL: &'static str = locale::DATETIME_FULL
pub fn now() -> Self
pub fn local() -> Self
pub fn from_iso(s: &str) -> Result<Self, String>
pub fn from_format(s: &str, _fmt: &str) -> Result<Self, String>
pub fn set_zone(self, _zone: &str) -> Self
pub fn plus(self, dur: &Duration) -> Self
pub fn minus(self, dur: &Duration) -> Self
pub fn start_of(self, unit: &str) -> Self
pub fn end_of(self, unit: &str) -> Self
pub fn to_iso(&self) -> String
pub fn to_format(&self, fmt: &str) -> String
pub fn to_locale_string(&self, preset: &str) -> String
pub fn diff(&self, other: &DateTime, unit: &str) -> f64
Trait Implementations§
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
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