[][src]Struct monotron_api::Timestamp

#[repr(C)]
pub struct Timestamp {
    pub year_from_1970: u8,
    pub month: u8,
    pub days: u8,
    pub hours: u8,
    pub minutes: u8,
    pub seconds: u8,
}

Describes an instant in time. The system only supports local time and has no concept of time zones.

Fields

year_from_1970: u8

The Gregorian calendar year, minus 1970 (so 10 is 1980, and 30 is the year 2000)

month: u8

The month of the year, where January is 1 and December is 12

days: u8

The day of the month where 1 is the first of the month, through to 28, 29, 30 or 31 (as appropriate)

hours: u8

The hour in the day, from 0 to 23

minutes: u8

The minutes past the hour, from 0 to 59

seconds: u8

The seconds past the minute, from 0 to 59. Note that some filesystems only have 2-second precision on their timestamps.

Methods

impl Timestamp[src]

pub fn day_of_week(&self) -> DayOfWeek[src]

Returns the day of the week for the given timestamp.

pub fn increment(&mut self, days: u32, seconds: u32)[src]

Move this timestamp forward by a number of days and seconds.

pub fn is_leap_year(&self) -> bool[src]

Returns true if this is a leap year, false otherwise.

pub fn days_in_month(&self) -> u8[src]

Returns the number of days in the current month

pub fn month_str(&self) -> &'static str[src]

Returns the current month as a UK English string (e.g. "August").

Trait Implementations

impl Debug for Timestamp[src]

impl Display for Timestamp[src]

impl PartialEq<Timestamp> for Timestamp[src]

impl Eq for Timestamp[src]

impl Clone for Timestamp[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Unpin for Timestamp

impl Send for Timestamp

impl Sync for Timestamp

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]