pub struct GmtOffset(_);
Expand description

The GMT offset in seconds for a mock time zone

Implementations

Attempt to create a GmtOffset from a seconds input. It returns an error when the seconds overflows or underflows.

Returns the raw offset value in seconds.

Returns true if the GmtOffset is positive, otherwise false.

Returns true if the GmtOffset is zero, otherwise false.

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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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.");

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.