pub struct DateTime {
pub year: u32,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
pub millisecond: u16,
pub timezone: TimeZone,
}
Expand description
DateTime is a Unix and UTC conversion util.
Example of converting a Unix to a DateTime UTC.
use embedded_utils::time::{DateTime, TimeZone};
let datetime = DateTime::from_unix_millis(1704067199998, TimeZone::UTC);
println!("datetime: {:?}", datetime);
Fields§
§year: u32
Year
month: u8
Month
day: u8
Day
hour: u8
Hour
minute: u8
Minute
second: u8
Second
millisecond: u16
Millisecond
timezone: TimeZone
Timezone
Implementations§
Trait Implementations§
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