pub struct DateUtil;Implementations§
Source§impl DateUtil
impl DateUtil
Sourcepub fn current_date_string() -> String
pub fn current_date_string() -> String
获取当前日期字符串,输出格式:%Y-%m-%d
Sourcepub fn current_time_string() -> String
pub fn current_time_string() -> String
获取当前时间字符串,输出格式:%Y-%m-%d %H:%M:%S
Sourcepub fn parse_datetime(time: &str) -> Result<DateTime<FixedOffset>, ParseError>
pub fn parse_datetime(time: &str) -> Result<DateTime<FixedOffset>, ParseError>
§参数
- time: 格式如:“2025-08-30 12:00:00”
Sourcepub fn current_timestamp() -> u64
pub fn current_timestamp() -> u64
当前时间戳(秒),返回10位长度
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