pub struct DateTimeHandler {
pub locale: String,
}Fields§
§locale: StringImplementations§
Source§impl DateTimeHandler
impl DateTimeHandler
pub fn new(locale: String) -> Self
pub fn parse_date(&self, date_str: &str) -> Result<NaiveDate, JourneyError>
pub fn parse_date_with_format_override( &self, date_str: &str, format_override: Option<&str>, ) -> Result<NaiveDate, JourneyError>
pub fn parse_time(&self, time_str: &str) -> Result<NaiveTime, JourneyError>
pub fn parse_time_with_format_override( &self, time_str: &str, format_override: Option<&str>, ) -> Result<NaiveTime, JourneyError>
pub fn parse_relative_date(&self, days_offset: i64) -> NaiveDate
pub fn format_date(&self, date: NaiveDate) -> String
pub fn format_datetime(&self, datetime: DateTime<Local>) -> String
pub fn format_time(&self, time: NaiveTime) -> String
pub fn get_current_datetime(&self) -> DateTime<Local>
pub fn combine_date_time( &self, date: NaiveDate, time: NaiveTime, ) -> DateTime<Local>
Auto Trait Implementations§
impl Freeze for DateTimeHandler
impl RefUnwindSafe for DateTimeHandler
impl Send for DateTimeHandler
impl Sync for DateTimeHandler
impl Unpin for DateTimeHandler
impl UnsafeUnpin for DateTimeHandler
impl UnwindSafe for DateTimeHandler
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