TimeZoneType

PackageAxial
Time zone values and UTC-to-local conversion.

Specification

Kind
Type
Members
8
Examples
0
utcSignature
TimeZone.utc
ofIdSignature
TimeZone.ofId id
ofTimeZoneInfoSignature
TimeZone.ofTimeZoneInfo zone
toTimeZoneInfoSignature
TimeZone.toTimeZoneInfo zone
idSignature
TimeZone.id zone

Summary

NameSignatureSynopsis
Operations
utcTimeZone.utc UTC, available on every target.
ofIdTimeZone.ofId idResolves an IANA id (or a Windows id on .NET) to a time zone value.
ofTimeZoneInfoTimeZone.ofTimeZoneInfo zoneWraps a caller-supplied System.TimeZoneInfo, preserving custom adjustment rules.
toTimeZoneInfoTimeZone.toTimeZoneInfo zoneReturns the preserved System.TimeZoneInfo, including any custom rules.
idTimeZone.id zoneThe time zone's id.
localTimeZone.local Reads the machine time zone as an explicit effect.
toLocalTimeZone.toLocal zone instantConverts a UTC instant to the zone's wall clock.
Idthis.IdNo description available.

Operations

kind:member

utc

TimeZone.utc
Member
UTC, available on every target.

Returns

TimeZone
kind:member

ofId

TimeZone.ofId id
Member
Resolves an IANA id (or a Windows id on .NET) to a time zone value.

Parameters

NameTypeDescription
idstring

Returns

Result<TimeZone, string>

Verification Examples

match TimeZone.ofId "Europe/Berlin" with
| Ok zone -> TimeZone.toLocal zone instant
| Error message -> message
kind:member

ofTimeZoneInfo

TimeZone.ofTimeZoneInfo zone
Member
Wraps a caller-supplied System.TimeZoneInfo, preserving custom adjustment rules.

Parameters

NameTypeDescription
zoneTimeZoneInfo

Returns

TimeZone
kind:member

toTimeZoneInfo

TimeZone.toTimeZoneInfo zone
Member
Returns the preserved System.TimeZoneInfo, including any custom rules.

Parameters

NameTypeDescription
zoneTimeZone

Returns

TimeZoneInfo
kind:member

id

TimeZone.id zone
Member
The time zone's id.

Parameters

NameTypeDescription
zoneTimeZone

Returns

string
kind:member

local

TimeZone.local
Member
Reads the machine time zone as an explicit effect.

Returns

Flow<'env, 'error, TimeZone>
kind:member

toLocal

TimeZone.toLocal zone instant
Member
Converts a UTC instant to the zone's wall clock.

Parameters

NameTypeDescription
zoneTimeZone
instantDateTimeOffset

Returns

DateTimeOffset

Verification Examples

TimeZone.local |> Flow.map (fun zone -> TimeZone.toLocal zone System.DateTimeOffset.UnixEpoch)
kind:member

Id

this.Id
Member

Returns

string