Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class NodaTime.​TimeZones.​ZoneLocalMapping

Assembly: NodaTime

Inheritance: object → ZoneLocalMapping

The result of mapping a <see cref="T:NodaTime.LocalDateTime" /> within a time zone, i.e. finding out at what "global" time the "local" time occurred.

Remarks

<para> This class is used as the return type of <see cref="M:NodaTime.DateTimeZone.MapLocal(NodaTime.LocalDateTime)" />. It allows for finely-grained handling of the three possible results: </para> <list type="bullet"> <item> <term>Unambiguous mapping</term> <description> The local time occurs exactly once in the target time zone. </description> </item> <item> <term>Ambiguous mapping</term> <description> The local time occurs twice in the target time zone, due to the offset from UTC changing. This usually occurs for an autumnal daylight saving transition, where the clocks are put back by an hour. If the clocks change from 2am to 1am for example, then 1:30am occurs twice - once before the transition and once afterwards. </description> </item> <item> <term>Impossible mapping</term> <description> The local time does not occur at all in the target time zone, due to the offset from UTC changing. This usually occurs for a vernal (spring-time) daylight saving transition, where the clocks are put forward by an hour. If the clocks change from 1am to 2am for example, then 1:30am is skipped entirely. </description> </item> </list>

Properties

public DateTimeZone
Zone
Gets the <see cref="T:NodaTime.DateTimeZone" /> in which this mapping was performed.
public LocalDateTime
LocalDateTime
Gets the <see cref="T:NodaTime.LocalDateTime" /> which was mapped within the time zone.
public ZoneInterval
EarlyInterval
Gets the earlier <see cref="T:NodaTime.TimeZones.ZoneInterval" /> within this mapping.
Remarks For unambiguous mappings, this is the same as <see cref="P:NodaTime.TimeZones.ZoneLocalMapping.LateInterval" /> ; for ambiguous mappings, this is the interval during which the mapped local time first occurs; for impossible mappings, this is the interval before which the mapped local time occurs.
public ZoneInterval
LateInterval
Gets the later <see cref="T:NodaTime.TimeZones.ZoneInterval" /> within this mapping.
Remarks For unambiguous mappings, this is the same as <see cref="P:NodaTime.TimeZones.ZoneLocalMapping.EarlyInterval" /> ; for ambiguous mappings, this is the interval during which the mapped local time last occurs; for impossible mappings, this is the interval after which the mapped local time occurs.
public int
Count
Gets the number of results within this mapping: the number of distinct <see cref="T:NodaTime.ZonedDateTime" /> values which map to the original <see cref="T:NodaTime.LocalDateTime" /> .

Methods

public ZonedDateTime
Single​()
Returns the single <see cref="T:NodaTime.ZonedDateTime" /> which maps to the original <see cref="T:NodaTime.LocalDateTime" /> in the mapped <see cref="T:NodaTime.DateTimeZone" /> .
Returns The unambiguous result of mapping the local date/time in the time zone.
public ZonedDateTime
First​()
Returns a <see cref="T:NodaTime.ZonedDateTime" /> which maps to the original <see cref="T:NodaTime.LocalDateTime" /> in the mapped <see cref="T:NodaTime.DateTimeZone" /> : either the single result if the mapping is unambiguous, or the earlier result if the local date/time occurs twice in the time zone due to a time zone offset change such as an autumnal daylight saving transition.
Returns The unambiguous result of mapping a local date/time in a time zone.
public ZonedDateTime
Last​()
Returns a <see cref="T:NodaTime.ZonedDateTime" /> which maps to the original <see cref="T:NodaTime.LocalDateTime" /> in the mapped <see cref="T:NodaTime.DateTimeZone" /> : either the single result if the mapping is unambiguous, or the later result if the local date/time occurs twice in the time zone due to a time zone offset change such as an autumnal daylight saving transition.
Returns The unambiguous result of mapping a local date/time in a time zone.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object