Struct icu_datetime::date::GmtOffset[][src]

pub struct GmtOffset(_);

The GMT offset in seconds for a MockTimeZone.

Implementations

impl GmtOffset[src]

pub fn try_new(seconds: i32) -> Result<Self, DateTimeError>[src]

pub fn raw_offset_seconds(&self) -> i32[src]

Returns the raw offset value in seconds.

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

Returns true if the GmtOffset is positive, otherwise false.

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

Returns true if the GmtOffset is zero, otherwise false.

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

Returns true if the GmtOffset has non-zero minutes, otherwise false.

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

Returns true if the GmtOffset has non-zero seconds, otherwise false.

Trait Implementations

impl Clone for GmtOffset[src]

impl Copy for GmtOffset[src]

impl Debug for GmtOffset[src]

impl Default for GmtOffset[src]

impl FromStr for GmtOffset[src]

type Err = DateTimeError

The associated error which can be returned from parsing.

fn from_str(input: &str) -> Result<Self, Self::Err>[src]

Parse a GmtOffset from a string.

The offset must range from GMT-12 to GMT+14. The string must be an ISO 8601 time zone designator: e.g. Z e.g. +05 e.g. +0500 e.g. +05:00

Examples

use icu::datetime::date::GmtOffset;

let offset0: GmtOffset = "Z".parse().expect("Failed to parse a GMT offset.");
let offset1: GmtOffset = "-09".parse().expect("Failed to parse a GMT offset.");
let offset2: GmtOffset = "-0930".parse().expect("Failed to parse a GMT offset.");
let offset3: GmtOffset = "-09:30".parse().expect("Failed to parse a GMT offset.");

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> ErasedDataStruct for T where
    T: Clone + Debug + Any
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> 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.