|DateTimeZone(String, Boolean, Offset, Offset)|
Initializes a new instance of theclass.
Maps the given LocalDateTime to the corresponding ZonedDateTime in a lenient manner: ambiguous values map to the later of the alternatives, and "skipped" values map to the start of the zone interval after the "gap".
Returns the earliest valid ZonedDateTime with the given local date.
Maps the given LocalDateTime to the corresponding ZonedDateTime, if and only if that mapping is unambiguous in this time zone. Otherwise, SkippedTimeException or AmbiguousTimeException is thrown, depending on whether the mapping is ambiguous or the local date/time is skipped entirely.
Determines whether the specified Object is equal to this instance.(Overrides Object.Equals(Object).)
Determines whether the specifiedis equal to this instance.
Implements equality in derived classes.
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Returns a fixed time zone with the given offset.
Returns a hash code for this instance.(Overrides Object.GetHashCode()()()().)
Gets the Type of the current instance.(Inherited from Object.)
Returns the offset from UTC, where a positive duration indicates that local time is later than UTC. In other words, local time = UTC + offset.
Gets the zone interval for the given instant; the range of time around the instant in which the same Offset applies.
The provider's ID for the time zone.
Returns complete information about how the given LocalDateTime is mapped in this time zone.
Returns the greatest (most positive) offset within this time zone, over all time.
Creates a shallow copy of the current Object.(Inherited from Object.)
Returns the least (most negative) offset within this time zone, over all time.
Maps the given LocalDateTime to the corresponding ZonedDateTime, following the given ZoneLocalMappingResolver to handle ambiguity and skipped times.
Returns the ID of this time zone.(Overrides Object.ToString()()()().)
Gets the UTC (Coordinated Universal Time) time zone. This is a single instance which is not provider-specific; it is guaranteed to have the ID "UTC", but may or may not be the instance returned by DateTimeZoneProviders.Default["UTC"]; that depends on whether the default provider has its own mapping for that ID.
The mapping is unambiguous in the "UTC to local" direction, but the reverse is not true: when the offset changes, usually due to a Daylight Saving transition, the change either creates a gap (a period of local time which never occurs in the time zone) or an ambiguity (a period of local time which occurs twice in the time zone). Mapping back from local time to an instant requires consideration of how these problematic times will be handled.
Noda Time provides various options when mapping local time to a specific instant:
- AtStrictly(LocalDateTime) will throw an exception if the mapping from local time is either ambiguous or impossible, i.e. if there is anything other than one instant which maps to the given local time.
- AtLeniently(LocalDateTime) will never throw an exception due to ambiguous or skipped times, resolving to the later option of ambiguous matches or the start of the zone interval after the gap for skipped times.
- ResolveLocal(LocalDateTime, ZoneLocalMappingResolver) will apply a ZoneLocalMappingResolver to the result of a mapping.
- MapLocal(LocalDateTime) will return a ZoneLocalMapping with complete information about whether the given local time occurs zero times, once or twice. This is the most fine-grained approach, which is the fiddliest to use but puts the caller in the most control.
Noda Time has two built-in sources of time zone data available: a copy of the "zoneinfo" (aka tz or Olson) database, and the ability to convert .NET's own TimeZoneInfo format into a "native" Noda Time zone. Which of these is most appropriate for you to use will very much depend on your exact needs. The zoneinfo database is widely used outside Windows, and has more historical data than the Windows-provided information, but if you need to interoperate with other Windows systems by specifying time zone IDs, you may wish to stick to the Windows time zones.
To obtain a GetSystemDefault()()()() on a provider to obtain the that the provider considers matches the system default time zone, or you can construct a BclDateTimeZone via ForSystemDefault()()()(), which returns a that wraps the system local TimeZoneInfo. The latter will always succeed, but has access only to that information available via the .NET time zone; the former may contain more complete data, but may (in uncommon cases) fail to find a matching .representing the system default time zone, you can either call
Note that Noda Time does not require that IEquatable<(Of <(<'T>)>)> in such a way that equivalent time zones compare as equal.instances be singletons. As far as reasonably possible, implementations should implement