[−][src]Struct monotron_api::Timestamp
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]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,