Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Parse

static func Parse(value: string, zone: TimeZone) -> Result<ZonedDateTime, DateTimeParseError>

Declaring type: ZonedDateTime
Module: System.Time
Assembly: System.Runtime.dll
Source file: ZonedDateTime.rvn

Parses an explicit-offset invariant timestamp and validates it against the supplied named zone.

Parameters

Name Type Description
value String The same complete numeric timestamp accepted by Instant.Parse.
zone TimeZone An explicitly resolved zone; the host zone is never inferred.

Return value

Result<ZonedDateTime, DateTimeParseError>

A zoned value, InvalidFormat, OutOfRange, or OffsetMismatch.

Remarks

Both UTC and local years must lie in the zone's supported range. An overlap is selected by its stated offset. Gaps and incorrect offsets return OffsetMismatch. No zone identifier is embedded in the text; resolve names separately with TimeZone.Find.