# TimeZoneInfo

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-timezoneinfo/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct TimeZoneInfo
```

Access to the local time zone of the current thread.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/time_zone_info.rs#L28)

## Members

- [`MAX_OFFSET`](#assoc_const-max_offset)
- [`set_local_utc_offset_provider`](#function-set_local_utc_offset_provider)
- [`get_local_utc_offset`](#function-get_local_utc_offset)
- [`get_utc_offset_of_local_time`](#function-get_utc_offset_of_local_time)

<a id="assoc_const-max_offset"></a>

### MAX_OFFSET

```rust
const MAX_OFFSET: SignedDuration
```

The largest offset from UTC, 14 hours (in either direction).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/time_zone_info.rs#L32)

<a id="function-set_local_utc_offset_provider"></a>

### set_local_utc_offset_provider

```rust
fn set_local_utc_offset_provider(provider: Option<LocalUtcOffsetProvider>) -> Option<LocalUtcOffsetProvider>
```

Installs (or with `None` removes) the provider of the local UTC offset
of the current thread and returns the previous one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/time_zone_info.rs#L36)

<a id="function-get_local_utc_offset"></a>

### get_local_utc_offset

```rust
fn get_local_utc_offset(utc_time: DateTime) -> SignedDuration
```

The offset of local time from UTC at the UTC instant `utc_time`
(zero when no provider is installed). The offset is truncated to whole
minutes and limited to 14 hours in either direction.

The provider is asked at the instant of `utc_time`; a date the
platform's `SystemTime` cannot hold (before 1970 on
`wasm32-unknown-unknown`) is asked at the Unix epoch.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/time_zone_info.rs#L47)

<a id="function-get_utc_offset_of_local_time"></a>

### get_utc_offset_of_local_time

```rust
fn get_utc_offset_of_local_time(local_time: DateTime) -> SignedDuration
```

The offset of local time from UTC for the local clock time
`local_time`. Around a transition of the offset the clock time can be
ambiguous or invalid; the offset in effect after the transition is
preferred.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/time_zone_info.rs#L64)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
