pub struct DateUtil {}Implementations§
Source§impl DateUtil
impl DateUtil
Sourcepub fn get_end_of_year(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_end_of_year(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_end_of_month(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_end_of_month(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_end_of_week(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_end_of_week(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_start_of_year(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_start_of_year(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_start_of_month(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_start_of_month(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_start_of_week(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_start_of_week(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_start_of_day_for_day(input_date: NaiveDate) -> NaiveDateTime
pub fn get_start_of_day_for_day(input_date: NaiveDate) -> NaiveDateTime
Sourcepub fn get_end_of_day_for_day(input_date: NaiveDate) -> NaiveDateTime
pub fn get_end_of_day_for_day(input_date: NaiveDate) -> NaiveDateTime
Sourcepub fn get_start_of_day(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_start_of_day(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn get_end_of_day(input_datetime: NaiveDateTime) -> NaiveDateTime
pub fn get_end_of_day(input_datetime: NaiveDateTime) -> NaiveDateTime
Sourcepub fn manipulate_time(
input_time: NaiveDateTime,
step: i64,
unit: TimeUnit,
) -> NaiveDateTime
pub fn manipulate_time( input_time: NaiveDateTime, step: i64, unit: TimeUnit, ) -> NaiveDateTime
对 NaiveDateTime 进行时间加减法
§参数
input_time: 输入时间step: 步长,可以是正数或负数unit: 时间单位,使用 TimeUnit 枚举表示
返回值: 计算后的时间
Sourcepub fn parse_time(
input: String,
format_str: DateTimeFormat,
) -> Option<NaiveDateTime>
pub fn parse_time( input: String, format_str: DateTimeFormat, ) -> Option<NaiveDateTime>
Sourcepub fn get_now_time_string(format_str: DateTimeFormat) -> String
pub fn get_now_time_string(format_str: DateTimeFormat) -> String
pub fn now() -> NaiveDateTime
Sourcepub fn get_now_time_utc_string(format_str: DateTimeFormat) -> String
pub fn get_now_time_utc_string(format_str: DateTimeFormat) -> String
Auto Trait Implementations§
impl Freeze for DateUtil
impl RefUnwindSafe for DateUtil
impl Send for DateUtil
impl Sync for DateUtil
impl Unpin for DateUtil
impl UnwindSafe for DateUtil
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