#[repr(C, packed(1))]pub struct DateTime {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
}
Expand description
日期和时间结构
Fields§
§tm_sec: c_int
秒 – 取值区间为[0,59]
tm_min: c_int
分 - 取值区间为[0,59]
tm_hour: c_int
时 - 取值区间为[0,23]
tm_mday: c_int
一个月中的日期 - 取值区间为[1,31]
tm_mon: c_int
月份(从一月开始,0代表一月) - 取值区间为[0,11]
tm_year: c_int
年份,其值等于实际年份减去1900
tm_wday: c_int
星期 – 取值区间为[0,6],其中0代表星期天,1代表星期一,以此类推
tm_yday: c_int
从每年的1月1日开始的天数 – 取值区间为[0,365],其中0代表1月1日,1代表1月2日,以此类推
tm_isdst: c_int
夏令时标识符,实行夏令时的时候,tm_isdst 为正。不实行夏令时的时候,tm_isdst 为 0。不确定时为负
Trait Implementations§
impl Copy 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