Struct icu_datetime::date::GmtOffset [−][src]
pub struct GmtOffset(_);
The GMT offset in seconds for a MockTimeZone
.
Implementations
impl GmtOffset
[src]
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 FromStr 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
impl RefUnwindSafe for GmtOffset
impl RefUnwindSafe for GmtOffset
impl UnwindSafe for GmtOffset
impl UnwindSafe for GmtOffset